Home › Forums › Calendar Products › Community Events › custom email template
- This topic has 10 replies, 2 voices, and was last updated 11 years, 6 months ago by
Casey.
-
AuthorPosts
-
September 1, 2014 at 11:22 pm #716530
astcit
ParticipantIm looking to be able to put the custom field details from my event submission form in the subject line of the email and the email notification itself…
I seem to have found aline within;
/the-events-calendar-community-events/tribe-community-events/tribe-community-events.php
to be able to change the subject line and contents of the email…
but where abouts do i find the right “ID” to grab the details from my custom field?below is the details from the email-template.php which i thought might point me in the right direction for the ID…this snipet below is used for the events organizer, and unfortunately doesn’t help me at all finding
<h3><?php _e( ‘Event Organizer’, ‘tribe-events-community’ ); ?></h3>
<p><?php echo tribe_get_organizer( tribe_get_event_meta( $post->ID, ‘_EventOrganizerID’, true ) ); ?></p>but i used this example to point out what im looking for;
where can i get the “_EventOrganizerID” style ID for my custom field I’ve created?thanks in advance for helping me out with this one, def a stickler!
September 2, 2014 at 6:13 am #717069Casey
Participantastcit,
Thanks for getting in touch! As of version 3.7 of the Community Events add-on, you can customize the email contents by overriding the email template located in ‘views/community/email-template.php’. Take a look at our themer’s guide to learn more about overriding template files.Unfortunately, we don’t currently have a way to change the Subject line of the email that is sent. If this is something you’d like to see in a future release, I would suggest submitting it as an idea on our UserVoice page. Our team periodically reviews the most popular ideas for possible inclusion in a future release of the plugin.
Hopefully that gets you pointed in the right direction, but let me know if you have further questions. Thanks! π
-Casey-
September 8, 2014 at 6:17 am #730475Casey
ParticipantI just wanted to follow up and see if youβre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! π
-Casey-
September 8, 2014 at 3:37 pm #731604astcit
Participantunfortunately i still do need assistance on this..
i just havent had the chance to play with it this past week due to other commitments, do you mind keeping this open until next week?September 8, 2014 at 8:30 pm #732074Casey
ParticipantNo problem! Just reply back here when you’ve had a chance to review my reply above. Thanks! π
-Casey-
September 22, 2014 at 8:10 pm #760101astcit
Participanthaving a deeper look into the themer’s guide, i have found a little more help, but im still having trouble π
i used the information from http://docs.tri.be/Events-Calendar-PRO/source-function-tribe_get_custom_field.html#156-168
which is exactly what i need… but its not working.. still…
ive tried so many combinations as well πh3><?php _e( ‘Asset’,’tribe-events-community’ ); ?></h3>
<p><?php echo tribe_get_custom_field( tribe_get_event_meta ( get_the_ID() )); ?>
<?php echo $label; ?>
<?php echo $value; ?><h3><?php _e( ‘Required Asset’, ‘tribe-events-community’ ); ?></h3>
<p><?php echo echo tribe_get_custom_field(‘Required Asset’, $event->ID)<?php echo tribe_get_custom_field(‘CustomFieldLabel’, $eventID) ?>
<h3><?php _e( ‘Asset’,’tribe-events-community’ ); ?></h3>
<p><?php echo tribe_get_custom_fields( get_the_ID() ); ?><h3><?php _e( ‘Asset’,’tribe-events-community’ ); ?></h3>
<p><?php echo tribe_get_custom_field( tribe_get_event_meta ( $post->ID, ‘$eventID’, true ) ); ?></p><h3><?php _e( ‘Asset’,’tribe-events-community’ ); ?></h3>
<p><?php echo tribe_get_custom_field( tribe_get_event_meta ( $post->ID, ‘_service_id’, true ) ); ?></p><h3><?php _e( ‘Requested Asset’, ‘tribe-events-community’); ?></h3>
<p><?php echo tribe_get_custom_field( TribeEventsCustomMeta::get_custom_field_by_label( $label, $eventID ) ); ?></p>WHERE AM I GOING WRONG?!
September 23, 2014 at 6:32 am #761358Casey
Participantastcit,
You should be able to just do something like this in the Community email template:
echo tribe_get_custom_field( 'The Label of your Additional Field', $tribe_event_id );
The tribe_get_custom_field() function accepts two parameters: the field label to search for, and the Event ID. So, if you correctly pass those two variables then the correct value should be returned.
Give that a shot and let me know if it does the trick. Thanks! π
-Casey-
September 25, 2014 at 7:22 pm #767116astcit
ParticipantHey bud,
def tried your above code;
echo tribe_get_custom_field( ‘asset’, $tribe_event_id );
and then like a million combinations of what i thought the tribe event id might have been….<p><?php echo tribe_get_custom_field( ‘Asset’, $eventID );
<p><?php echo tribe_get_custom_field( ‘asset’, $tribe_event_id );
<p><?php echo tribe_get_custom_field( ‘$Asset’, $tribe_event_id );
<p><?php echo tribe_get_custom_field( tribe_get_event_meta( $post->ID, ‘asset’, true ) ); ?></p>
<p><?php echo tribe_get_custom_field( tribe_get_event_meta( $post->ID, ‘Asset’, true ) ); ?></p>
<p><?php echo tribe_get_custom_field( tribe_get_event_meta( $post->ID, ‘_AssetID’, true ) ); ?></p>
<p><?php echo tribe_get_custom_field( echo tribe_get_custom_field( ‘Asset’, $customField ) ); ?></p>
<p><?php echo tribe_get_custom_field( echo tribe_get_custom_field( ‘Asset’, ‘$customField’, true ) ); ?></p>i feel like I’m stuck with such a simple problem that’s laughing at me in the face now π
September 26, 2014 at 5:54 am #768135Casey
Participantastcit,
When you look at your ‘Additional Fields’ (Events->Settings->Additional Fields), what is the label name of the field you’re trying to display (screenshot) ? The first parameter in ‘tribe_get_custom_field’ should match that field label exactly.I was able to successfully do this, using the following steps:
- Perform a template override of ’email-template.php’ by copying the file to ‘MY_THEME_DIR/tribe-events/community/email-template.php’
- Added the custom code below to ’email-template.php’
<?php echo tribe_get_custom_field( 'Asset', $tribe_event_id ); ?>
Then I was able to see the value of the ‘Asset’ field that was submitted via the Community form. Give those steps a try and see if there’s something that you’re missing. Thanks! π
-Casey-
September 28, 2014 at 9:30 pm #774635astcit
Participanti bow down to you…
i swear i tried that π
not sure what the hell it was that i was doing wrong.
its working now.
you sir, are a god.September 29, 2014 at 6:10 am #775464Casey
ParticipantHa! π Thanks for the kind words, and glad to hear you were able to get this working.
Since it looks like you’re all set here, I’ll go ahead and close out this thread. Feel free to create a new thread if you have further questions! Thanks! π
-Casey-
-
AuthorPosts
- The topic ‘custom email template’ is closed to new replies.
