Support

Home Forums Event Espresso Premium EE4 – EE email template – How tu use it in custom template

EE4 – EE email template – How tu use it in custom template

Posted: January 17, 2016 at 6:18 am

Viewing 1 reply thread


JacquesMivi

January 17, 2016 at 6:18 am

Hello,

I wish to use a new template email created in EE message menu.

Actually I have

// email data
$name = ‘test’;
$email = ‘contact@viviarto.com’;
$to = ‘customn@gmail.com’;
$headers = ‘From: ‘ . $name . ‘ <‘ . $email . ‘>’ . “\r\n”;
$subject = ‘Email 1 – ‘ . wp_strip_all_tags($_POST[‘acf’][‘field_54dfc93e35ec4’]); // Post Title ACF field key
$body = $_POST[‘acf’][‘field_54dfc94e35ec5’] . ‘\r\n’;
$body = $body . ‘Lien : ‘ . ‘%post_url%’ . ‘\r\n’;
$body = $body . ‘Salle’ . $_POST[‘acf’][‘field_569b7988a2e49’] . ‘\r\n’;

// send email
wp_mail($to, $subject, $body, $headers );

How can I call the EE template, give some arguments (Fields form ou ACF fields) and send the email ?

Thanks for your help,


Josh

  • Support Staff

January 18, 2016 at 6:10 pm

We have some documentation for registering a new messages template pack, which since you didn’t specify which type of message you want to make a template for, will give you the most flexibility:

http://developer.eventespresso.com/docs/registering-a-messages-template-pack/

Please note that you do not need to build a custom template to get ACF fields. Any of the built in Event Espresso message template sections that support the [EVENT_META_*] shortcode will pull custom fields from ACF.

Viewing 1 reply thread

The support post ‘EE4 – EE email template – How tu use it in custom template’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso