How to get or pass email variables into phtml - php

Ok guys, wasted half a day on this and am giving up now.
Under my Your Account Has Been Activated email, I want to add to the email the Customer Unique Id code which is nothing more than the customer's initial + the Customer Id which I dynamically create using php.
Now I have the customer id {{var customer.getId()}} coming to the email and I have
{{block type='core/template' area='frontend' template='email/customer_uniq_id.phtml' customer_id_var='{{var customer.getId()}}' }}
which I am trying to pass customer_id_var with the Id to my customer_uniq_id.phtml
But it is not working and I have tried this:
echo Mage::getModel('core/variable')->loadByCode('customer.ID')->getValue('plain');
and other codes but nothing.
Any clues on how to get the customer id when sending the email?
Cheers guys

Try $this->getData('order') as mentioned here: http://www.webspeaks.in/2011/06/customize-new-order-email-template-in-magento.html

Related

Subject and email heading not showing in woocommerce email template

Developing a site in wordpress and I'm using WooCommerce.
When an order is placed the siteadmin (me) and the customer are receiving an email.
The email subject field and the email header (in the message body) are properly filled in.
However when an order is complete the subject field and the email header remains empty. Of course I have filled out the settings form for this email template.
See images below.
Any idea what I'm doing wrong? Please advice.
I don't know how it went but suddenly, this morning it is working. As far as I know I didn't change anything. Happy it works..... thanks.

Woocommerce confirm booking email to show customer information

I'm sure this is something very simple to do, but I just can't figure it out.
My questions concerns the WooCommerce booking confirmation email that is being sent to the admin. I would like it to contain all of the customer information including address and meta.
Does anyone know how to pull the info into the email?
Read this, you will find the answer : https://www.sellwithwp.com/customizing-woocommerce-order-emails/

Redirect URL to a specific page in wordpress

I am creating a plugin, in which I send newsletters to subscribed users. To do this, I first created a form, in which users enter their email-id, and been subscribed. After subscribing, they got an email for confirming their email-id. Here is the problem arise.
To confirm, I send them a link for confirming their email id as following:
http://localhost/wordpress/wp-content/plugins/my-plugin-path/templates/subscribe.php?id=53cad9f23a6ec
While I have to send them the link as following:
http://localhost/wordpress/newsletter/confirmation/53cad9f23a6ec
So how it can be done. Please help me. Any help would be appreciated. Thank you.

Adding a Button that Sends an Email in an Email

So I have customers that go to my site and request quotes for moving their cars. I get this form emailed to me and then I reply in an email with their quote. In this email I ask them to reply saying that they are ready to move their cars so that I can begin working on setting up their move.
However I feel I can make this step more streamlined. I'd like to have a button in my email that just says something like "Click here if you are ready to move your car!" Is this possible?
I would need this button to let me know which customer it is. I have a unique ID for every job and I could manually configure it before I send the email with the quote. Any help would be appreciated.
The only way to do this is with URL parameters. Something like:
Click Here to Confirm
That could be an image/button if you prefer. You would then use $_GET('account') on your page to access the query/parameter values.
You would have to dynamically insert the custome values before you send the email, as you can't change any of the code once it is sent. There are plenty of transactional email services that can help streamline this for you, all of which are designed to integrate with API's. A couple of good ones that come to mind are SendGrid, Mandrill and Mailjet.
Best thing to do would be to insert a link to a page on your website passing the unique ID as a query string. Then your page can display some sort of confirmation message to the customer and send you a message saying that the customer is ready.

How to add firstname and lastname in magento newsletter subscription?

I am new to magento. Magento default have only email id for newsletter subscrption. How add the first name and last name in the newsletter subscription? I saw many tutorials. But they are not much clear. Help me to find out this?
There is a free extension, that adds fields for gender, firstname and lastname and makes it available in the backend grid for export via xml/csv: http://www.magentocommerce.com/magento-connect/extended-newsletter-subscription-for-guests.html
You can use both function variables {{var subscriber.getSubscriberFirstname()}} and {{var subscriber.getSubscriberLastname()}} in your email templates.
It will use the guests name entered in the extended subscription form or the customers name, if the user is logged in. The only thing is that if the user is logged in and fills out the extended subscription form with another email address than the one he has registered with, those two variables will return nothing.
Go to System > Transactional Email > Choose one layout to edit. Use this var:
{{var customer.lastname}}
See more at: http://www.mesmerlab.com/create-new-email-template-magento/
The problem is that in the newsletter_subscriber table there are no columns for first name or last name.
This has been addressed in the answer to this question:
Adding a custom field to Magento's subscription module

Categories