I want to send new register customer email with one variable generated by script.
I am trying using $customerObj->sendNewAccountEmail('confirmed');
Please tell
How I can send custom email template with variable?
I have created one custom email template 'new register email'
in transactional emails with {{var myvar}}
Best Answer
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:
The recipient address, just literally needs to be a string, similarly to the mail subject.
Set your template id:
And finally declare your custom variables to be sent along to the template:
Followed up with the send function, i tend to just leave the $name as a null var:
Then in your template call the var as literal for example: