I would like to add an action to the Opportunity screen that would load an email template, populate the template with fields from the Opportunity.
The part I struggle with is how to load template X and have the fields populated in an email activity.
I would like to add an action to the Opportunity screen that would load an email template, populate the template with fields from the Opportunity.
The part I struggle with is how to load template X and have the fields populated in an email activity.
Best answer by Zoltan Febert
You can get an email template like this:
var templateID = "your template ID";
var notification = PXSelect<Notification,
Where<Notification.notificationID, Equal<Required<Notification.notificationID>>>>
.Select(Base, templateID);Once you have it, you can modify the body:
notification.Body = notification.Body.Replace("{YourField}", yourValue);
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.