Hi,
I'm trying to send an email when a member purchases a subscription. I have created a plugin for the paidsub_build hook:
Code:
$message = fetch_template('subscription_email_onjoin_'.$subscriptionid);
vbmail($user[email], "Thank you for your subscription!", $message, true);
I also tried:
Code:
eval('$emailmsg = "' . fetch_template('subscription_email_onjoin_'.$subscriptionid) . '";');
vbmail($user[email], "Thank you for your subscription!", $emailmsg, true);
Having done extensive testing, I have narrowed the problem down to the fetch_template consistently returning a blank string. The template "subscription_email_onjoin_1" exists, and $subscriptionid definitely is returning "1". I have also tried using the cache_templates hook and writing a plugin with
Code:
$globaltemplates[]='subscription_email_onjoin_1'
, no luck.
I have spent several hours googling for all variations of previously posted help on fetch_template, but no luck.
TIA for any help anyone can provide!
--------------- Added [DATE]1255161944[/DATE] at [TIME]1255161944[/TIME] ---------------
I've also tried using phrases (created them, linked them to the product with the dropdown that appears when you create the phrase) with no luck either.
$message = fetch_phrase('subscription_email_onjoin_'.$subscri ptionid, 1, '', false);
vbmail($user[email], "Thank you for your subscription!", $message, true);
For the life of me I cannot work out what the first two variables for fetch_phrase is meant to be. I have looked at everything!
* @param string Varname of the phrase to be fetched
* @param integer Phrase Type ID of the phrase to be fetched
There is no more documentation on what "Phrase Type ID of the phrase to be fetched" means that I can find. It's not the product id, it's nothing I can see on the phrase edit page itself either... help!
--------------- Added [DATE]1255220830[/DATE] at [TIME]1255220830[/TIME] ---------------
Hi

Is this in the wrong section?