Home › Forums › Calendar Products › Community Events › add link to event in confirmation email
- This topic has 5 replies, 2 voices, and was last updated 8 years, 8 months ago by Nico.
-
AuthorPosts
-
August 5, 2015 at 2:00 pm #993590Tony AshParticipant
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?
August 6, 2015 at 6:55 am #993844NicoMemberHi 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,
NicoAugust 9, 2015 at 11:03 pm #994653Tony AshParticipantThis doesn’t seem to be working. There is no link in the email but everything else shows up fine.
August 10, 2015 at 6:55 am #994709NicoMemberHey 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,
NicoAugust 11, 2015 at 2:58 pm #995243Tony AshParticipantThis worked! Thanks π
August 12, 2015 at 11:15 am #995495NicoMemberGlad 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 -
AuthorPosts
- The topic ‘add link to event in confirmation email’ is closed to new replies.