add link to event in confirmation email

Home Forums Calendar Products Community Events add link to event in confirmation email

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #993590
    Tony Ash
    Participant

    Hello,
    I used the code snippet here: https://theeventscalendar.com/support/forums/topic/send-event-organizer-an-email-after-event-submission/ to send an email to a community event organizer, but I’d also like to include a link to the event they submitted.

    What do I need to add to the code snippet so they will get a URL to the event they submitted in their email?

    #993844
    Nico
    Member

    Hi Tony,

    Thanks for reaching out, and glad to help you in this once again!

    You can get the event link with the tribe_event_link function. So you could be doing something like the following:


    add_action( 'tribe_community_event_created', 'notify_organizer' );

    function notify_organizer ( $event_id ) {
    $email = tribe_get_organizer_email( $event_id );

    if( !empty($email) ) {

    $subject = 'Hey Organizer';
    $message = 'Just wanted to let you now about a new event: ' . tribe_event_link ( $event_id );

    wp_mail( $email, $subject, $message );
    }
    }

    Please give this a try and let me know,
    Best,
    Nico

    #994653
    Tony Ash
    Participant

    This doesn’t seem to be working. There is no link in the email but everything else shows up fine.

    #994709
    Nico
    Member

    Hey Tony,

    Thanks for the follow-up! I’m sorry that didn’t work it was my bad πŸ™ tribe_event_link function echos the link, so you should use tribe_get_event_link to get that instead. Here’s the updated snippet:


    add_action( 'tribe_community_event_created', 'notify_organizer' );

    function notify_organizer ( $event_id ) {
    $email = tribe_get_organizer_email( $event_id );

    if( !empty($email) ) {

    $subject = 'Hey Organizer';
    $message = 'Just wanted to let you now about a new event: ' . tribe_get_event_link ( $event_id );

    wp_mail( $email, $subject, $message );
    }
    }

    PLease try it out once again and let me know,
    Best,
    Nico

    #995243
    Tony Ash
    Participant

    This worked! Thanks πŸ™‚

    #995495
    Nico
    Member

    Glad to hear Tony πŸ™‚

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to help.

    Best,
    Nico

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘add link to event in confirmation email’ is closed to new replies.