We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

4

This is expected behavior the User fields you are referencing are the sending user fields User fields are also known as Sending User fields for administrators and users with the “Manage Users” permission. Use them in email templates when referencing the person sending the email. https://help.salesforce.com/articleView?id=merge_fields_email_templates_cex....


0

Based on this answer, the correct way to set the Content Type for an xlsx file is to use application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, not text/xlsx.


0

Your code is not asking for XLSX format. You're asking for either CSV or XLS format, depending on which lines are commented out. Changing the filename or MIME type on the attachment object has no effect on what file format is produced. Inspecting the URL generated when exporting an XLSX-format report in Lightning yields the URL format https://<mydomain&...


-1


0

depending on how you are sending the email (eg. javascript, Apex Callout) If you're using apex... The SingleEmailMessage has the Email class as a parent class. Therefore you can use the method setUseSignature(useSignature) as outlined in the Email Documentation. When set to false the Users signature will not be added to the email. I'm not sure if you ...


2

As the error suggests, your issue is on the line where you are calling the method. // orgWideMail[0] is an instance of OrgWideEmail mail = createEmailMessage(emailtemplate, orgWideMail[0], .....); You are passing a single record of type OrgWideEmailAddress when you are calling the method, whereas your method is declared to accept a List<...


1

Your types simply don't match up, as the error is indicating. You declare: public List<Messaging.SingleEmailMessage> createEmailMessage( Id templateName, Id orgEmailAddress, Id targetObjectId, Id whatId, Id accountManagerEmail, boolean accountManagerStatus, Id accountOwnerEmail, boolean accountOwnerStatus, String ...


0

It is a best practice to get the query results in a list. If a query does not return any rows we get List has no rows for assignment to sobject error. What I think is your code is failing because EmailTemplate query is not returning any rows. You can update code as below : public static String ADVISOR = 'Advisor'; List<User> users = [ SELECT ...


0

The Messaging.MassEmailMessage does not have a toAddresses property. With that class, you specify target objects via setTargetObjectIds(), which accepts a list of Id values of Contacts, Users, or Leads. It appears that you probably meant to declare the variable mail as Messaging.SingleEmailMessage. As a first step in debugging, it's important to validate ...


1

The problem you're having here is you cannot send different attachments to individual recipients of the same (common) bulk email. Either they all receive the same email with the same attachment or they do not. To do what you want to do, you'd need to have a marketing tool from Marketing Cloud like Journey Builder. You're attempting to send the equivalent of ...


1

You are adding your attachments to efaLis, that's why in this line of code mail.setFileAttachments(efaList); you're attaching all existing pdfs in list to current mail. Change this line on mail.setFileAttachments(new List<Messaging.EmailFileAttachment>{efa1}); and everything's going to be okay.


Top 50 recent answers are included