Jump to:

10843 Posts in 2514 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Personalized Email UserForms

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 708 Views
  • ragunalth
    Avatar
    Community Member
    14 Posts

    Personalized Email UserForms Link to this post

    To send personalized emails using user form add the following code to append to the body.

    foreach($emailData['Fields'] as $Field)
    $body = preg_replace('#\b'.$Field->Name.'(|\b)#u', $Field->Value, $body);
    }

    Add the relevant text field in the body of the email under email recipients. Example

    Hi EditableTextField2
    Thanks for sending me an email.
    Kind Regards
    EditableTextField1

    Result

    Hi Paul
    Thanks for sending me an email.
    Kind Regards
    John

    708 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.