Jump to content
Server Maintenance This Week. ×

Email Body Substitute


This topic is 5672 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I want to use the Emailbody Substitute multiple times on the same block of text but for different search strings. For example the fist section of text is

Dear 1 2

I would want to replace 1 with the field Title and 2 with the field last name. When I do this it only does the second one.

This is the calculation I used:

EmailBodySubstitute( "1" ; Customers::Title) and

EmailBodySubstitute( "2" ; Customers::Last_Name)

Is there a way to fix this?

NB. I have tried putting all of the text together in a field in the database first and simply doing the replace with all of the text but this does not take any line breaks.

Link to comment
Share on other sites

Format the substitutions as follows:

Let(

[

text = emailtext ;

sub1 = substitute( text ; "1" ; CUstomers::Title) ;

sub2 = substitute( sub1 ; "2" ; CUstomers::Last_Name) ;

sub3 = substitute( sub2 ; "3" ; CUstomers::First_Name)

];

sub3 )

Link to comment
Share on other sites

Hi there

Thank you for the reply but I am not very experienced with this plug in and am not sure how to use the code you have provided.

I should have given you the full code I am using this is:

EmailCreate( "[email protected]" ; Customers::Email_Business ; "Welcome to Exel gaming read this and how you view life could change forever!" ) and

EmailSetBodyFile( "http://exelgaming.accountsupport.com/mail/M1mail.html" ; False ) and

EmailBodySubstitute( "1" ; Customers::Title ) and

EmailBodySubstitute( "2" ; Customers::Last_Name ) and

EmailSend

The bulk of the Email text is on the webpage.

I hope this makes sense.

John

Link to comment
Share on other sites

  • 3 weeks later...

EmailCreate( "[email protected]" ; Customers::Email_Business ; "Welcome to Exel gaming read this and how you view life could change forever!" ) and

EmailSetBodyFile( "http://exelgaming.accountsupport.com/mail/M1mail.html" ; False ) and

EmailBodySubstitute( "1" ; Customers::Title ) and

EmailBodySubstitute( "2" ; Customers::Last_Name ) and

EmailSend

In the EmailBodySubstitute function, the first argument must be a string which appears in the original message body somewhere. So you can do something like this:

EmailCreate( "[email protected]" ; Customers::Email_Business ; "Dear $TITLE$ $LASTNAME$, Welcome to Exel gaming read this and how you view life could change forever!" )  and 

EmailSetBodyFile( "http://exelgaming.accountsupport.com/mail/M1mail.html" ; False ) and 

EmailBodySubstitute( "$TITLE$" ; Customers::Title ) and 

EmailBodySubstitute( "$LASTNAME$" ; Customers::Last_Name ) and 

EmailSend

Link to comment
Share on other sites

This topic is 5672 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.