• Resolved vittorio09

    (@vittorio09)


    Hi,

    I managed to get an extra-attribute in my frontend form, and actually when I create a new event I can see the attribute value correctly filled in the “attributes” section of the event.

    Unfortunately on the confirmation e-mail I can see all the fields but not the attribute.

    Here you can find the code for the e-mail:

    add_action('eme_insert_event_action','eme_mail_event');
    function eme_mail_event ($event) {
       $contact = eme_get_contact ($event);
       $contact_email = $contact->user_email;
       $contact_name = $contact->display_name;
       $subject_format="New Event:' #_EVENTNAME 'from: #_ATT{event_creator_name} ";
       $body_format="Event name: ' #_EVENTNAME ', From: #_ATT{event_creator_name} , Mail 
       body: #_EVENTFIELD{event_contactperson_email_body} ";
    
       $subject=eme_replace_placeholders($subject_format, $event, "text");
       $body=eme_replace_placeholders($body_format, $event, "text");
       $blogusers = get_users();
     
          eme_send_mail($subject,$body, 'mail@myemail', me, $contact_email, $contact_name);
       }
    

    I correctly receive all the placeholders but not the #att{xx}

    Is there any known reason?

    Thank you in advance for your prompt support!

    • This topic was modified 8 years, 7 months ago by vittorio09.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Franky

    (@liedekef)

    Do a print_r (or var_dump) of $event in your generated mail, see if $event[‘event_attributes’] is filled out correctly.

    Thread Starter vittorio09

    (@vittorio09)

    Hi

    The output is:

    
     [event_attributes] => a:1:{s:18:"event_creator_name";s:8:"Vittorio";}
    
    Thread Starter vittorio09

    (@vittorio09)

    Should it be right?

    Plugin Author Franky

    (@liedekef)

    Hmmm it seems that parameter is already serialised there. Before the call to replace the placeholders, do an unserialise on $event[‘event_attributes’]

    Thread Starter vittorio09

    (@vittorio09)

    Frankly I’m not so able in Php.

    It is sufficient to write:

    unserialize($event[event_attributes]); ?

    Plugin Author Franky

    (@liedekef)

    This should do it :

    $event['event_attributes'] = unserialize($event['event_attributes']);

    But it is a bug and I’ll fix it for the next version.

    • This reply was modified 8 years, 7 months ago by Franky.
    Thread Starter vittorio09

    (@vittorio09)

    Thank you Franky! It works!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Attributes not shown in e-mails’ is closed to new replies.