Skip to main content
Nintex Community Menu Bar
Question

How to send email from Snippet ?

  • July 9, 2024
  • 4 replies
  • 13 views

Forum|alt.badge.img+3

Hi All,

How to send emails through SNIPPET?, like Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); in salesforce.

Here I need to send HTML template, my code like this:

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();        mail.setTargetObjectId(NewContact.Id);  
mail.setTemplateId(‘00XD00000024V1F’);     //HTML Template
mail.setOrgWideEmailAddressId(emailAddress.Id); // Email Address to send
mail.setWhatId(nominationId);   // this
Messaging.sendEmail(new Messaging.SingleEmailMessage { mail });


Please help me out.


Thank you
Shaik.

This topic has been closed for replies.

4 replies

Forum|alt.badge.img+17
  • Nintex Employee
  • 3766 replies
  • July 9, 2024

Sorry.  You can’t put Apex in your Javascript. 

You make a remoting call from your Javascript to an Apex function.  That is detailed here:  https://community.skuid.com/t/calling-apex-function



Forum|alt.badge.img+3
  • Author
  • 16 replies
  • July 9, 2024

Hi Rob, It is my Visualforce page Code, Sorry i’m not mention this line in previous post. Here my question is How we can achieve this type of mailing functionality ? We are developing Skuid page to replace Visualforce page, we are struck at this functionality Actual functionality of VF Page was “when the user click SAVE button, 1. Records creation/updation in Standard/custom object and 2. Sending an Email with template” We don’t know how to achieve the second point by using snippet???. Please help me out Thank you Shaik.


Forum|alt.badge.img+17
  • Nintex Employee
  • 3766 replies
  • July 9, 2024

I’d keep this funtion in your VF page, and then include the Skuid page in your vf page using the skuid:page method. That method is detailed in Zach’s post that I linked to above. It is option #4 in his write up.


Forum|alt.badge.img+3
  • Author
  • 16 replies
  • July 9, 2024

Hi Rob,

Thanks for your replay, We did sending mail  functionality :), With option#1 from Zach’s post.

Thank you


Shaik.