More or less a few arrays to setup, I would suggest tacking onto an observer event (or a core rewrite, in which case you'll find the send function for customer registrations in the mage core customer folder!) to send your custom script out (there's a list of the observers available if you google!):
Declare the sender as an array:
$sender = Array('name' => 'You',
'email' => 'you@domain.com');
The recipient address, just literally needs to be a string, similarly to the mail subject.
$email = 'customer@customer.com';
Set your template id:
$templateId = 40;
And finally declare your custom variables to be sent along to the template:
$vars = Array('nameOfCustomer' => $customerName,
'shippingDetails' => $shipping,
'storeName' => $store_name,
'storeURL' => $store_url,
'orderId' => $orderId);
Followed up with the send function, i tend to just leave the $name as a null var:
$storeId = Mage::app()->getStore()->getId();
$translate = Mage::getSingleton('core/translate');
Mage::getModel('core/email_template')
->setTemplateSubject($mailSubject)
->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
Then in your template call the var as literal for example:
{{var storeName}}
It's probably your database entries.
Take a look at core_config_data
:
SELECT `value` FROM `core_config_data` WHERE `path` = 'snh/emailsettings/headerfnt';
If it does return something, then it'd be a scope problem then. Check if scope
and scope_id
checks out (global, website, store level?). Safest way to go is default
and 0
, respectively.
If it does not return anything, then you need to insert something for this. You obviously probably know now what to insert, right?
Best Answer
To add a custom variable, please follow below admin path.
1) Login in to admin.
2) go to SYSTEM -> Custom Variable (under "Other setting").
3) Click "Add New Variable" button.
4) Enter Variable Code,Variable Name,Variable HTML Value [optional], Variable Plain Value[optional]
5) Click "Save" button.