Skip to main content
Solved

Create Action to Preview Email before sending


Forum|alt.badge.img

Hello,

 

I am working on creating an Action to preview and send an email created from an email template. I have the email template created and now I want to add an action to a page to call the template and show a preview where the user can edit the email if necessary. However, I am not finding anything on this.

 

Any help is appreciated.

Thanks

Best answer by darylbowman

This will open a new window with a blank email. I’m not actually sure how to load a template, but you could probably look through the source code to find somewhere where that is done.

public PXAction<ARInvoice> action;

[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "New Email")]
public void Action()
{
	var emailGraph = PXGraph.CreateInstance<CREmailActivityMaint>();
	emailGraph.Message.Current = new CRSMEmail();

	throw new PXRedirectRequiredException(emailGraph, true, "");

}

 

View original
Did this topic help you find an answer to your question?

darylbowman
Captain II
Forum|alt.badge.img+13

This will open a new window with a blank email. I’m not actually sure how to load a template, but you could probably look through the source code to find somewhere where that is done.

public PXAction<ARInvoice> action;

[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "New Email")]
public void Action()
{
	var emailGraph = PXGraph.CreateInstance<CREmailActivityMaint>();
	emailGraph.Message.Current = new CRSMEmail();

	throw new PXRedirectRequiredException(emailGraph, true, "");

}

 


Forum|alt.badge.img

@darylbowman 

Thanks!

 

This worked.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings