Hi, is it possible to have a complete list of all tokens that can be used in the email? I noticed that those present here: https://codex.buddypress.org/emails/email-tokens/ are not all because for example this {{meeting.name}} which is used in the meet reminder is not listed.
I ask you this question because my goal is to be able to insert a particular field of the tutor in the emails, such as a google meet link.
The tokens are not generalised they are also specific to emails.
So the emails look like this :
'student_course_start'=>array(
'description'=> __('Student : Student started a course','wplms'),
'subject' => sprintf(__('You started course %s','wplms'),'{{course.name}}'),
'message' => sprintf(__('You\'ve started the course : %s','wplms'),'{{{course.titlelink}}}')
),
and the token here is course.titelink. and it is evaluated by our function
function bp_course_wp_mail($to,$subject,$message,$args=''){
/*=== Migartion to BuddyPRess HTML emails ==*/
$mails = bp_course_mails::init();
$y = $mails->emails_migrated(); // for php 5.4 and below
if( $y && !empty($args['tokens']) ){
$email_type = $args['action'];
$bpargs = array(
'tokens' => $args['tokens'],
);
bp_send_email( $email_type,$to, $bpargs );
return;
}
}
The $args['token'] is a key=>value array
so course.titlelink is the key and corresponding value is inserted into the mail at the time of processing.
At the time of processing of the email, this token is evaluated.
So now, after recieving your request I am adding this filter :
using this filter you can add and evaluate your custom token across all the emails. The $args will help you target one specific mail as well by comparing the $args['action'] with the email action.
Hi, is it possible to have a complete list of all tokens that can be used in the email?
I noticed that those present here: https://codex.buddypress.org/emails/email-tokens/ are not all because for example this {{meeting.name}} which is used in the meet reminder is not listed.
I ask you this question because my goal is to be able to insert a particular field of the tutor in the emails, such as a google meet link.
The tokens are not generalised they are also specific to emails.
So the emails look like this :
and the token here is course.titelink. and it is evaluated by our function
The $args['token'] is a key=>value array
so course.titlelink is the key and corresponding value is inserted into the mail at the time of processing.
At the time of processing of the email, this token is evaluated.
So now, after recieving your request I am adding this filter :
using this filter you can add and evaluate your custom token across all the emails. The $args will help you target one specific mail as well by comparing the $args['action'] with the email action.