• Firoz Khan 17
  • NEWBIE
  • 5 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi 

I am following the lighting web component trailhead (https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component ).
I created the web component, but when i try to add it to the home component, the custom web component is not showing and cannot add it to the home page. The helloworld.js-meta.xml file is same as what metioned in the trailhead account.
I am doing this in my trailhead playground. Any help on this will be highly appreciated
  • March 11, 2019
  • Like
  • 0
Hi,

when send email to customer add Email attachment, i know  add email attachment with visualforce page but how to add attachment with Email template, below code get only body of the email template but not images and merge fields. please guide me how to get merge fields and images in email file attachment.

My class:

Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
       
      EmailTemplate et=[Select id,Subject,body,HtmlValue from EmailTemplate where name=:'Gala Thank You Letter From Payment'];

       Blob b = Blob.valueOf(et.body);
      
       Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
       efa.setFileName('attachment.txt');
       efa.setBody(b);
      
       String addresses;
      
       addresses = pmnt.pymt__Contact__r.Email;
      
       String[] toAddresses = addresses.split(':', 0);
        email.setSubject( 'Thank You For Your Donation');
        email.setToAddresses( toAddresses );
        email.setPlainTextBody( 'Thank You .');
        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
        email.setSaveAsActivity(true);
        Messaging.SendEmailResult [] r =
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});


Thanks.