Jump to content

[SOLVED] Add Mobile Number to Email Alerts


Recommended Posts

I am trying to add my customer's mobile telephone number to my email alerts.

 

In my mailalerts.php I have the following

 

'{delivery_phone}' => $delivery->phone,
'{delivery_phone_mobile}' => $delivery->phone_mobile,

'{invoice_phone}' => $invoice->phone,
'{invoice_phone_mobile}' => $invoice->phone_mobile,

 

 My "new_order.html" has the following:

 

                        {invoice_block_html} & {delivery_block_html}

 

Which gives me all the delivery and invoice details, including the Home telephone number, but not the mobile number.

 

I have added {invoice_phone_mobile} and also tested {Phone_mobile}, but neither give me the mobile number, just the code I inserted.

 

I have placed an order with a test account and the account does have a mobile number added.

 

Anyone any ideas?

 

Thanks in advance...

Edited by glennlawre (see edit history)
Link to comment
Share on other sites

Don't know what was going on here but I just recheked my mailalerts.php and the "phone_mobile" entries where gone! Maybe I was checking the worng file the other day or something!

 

Anyway, here's how to fix this issue if anyone else has it:

 

PS v1.5.6.1

 

In "/wwwroot/modules/mailalerts/mailalerts.php" insert -

 

            '{delivery_phone_mobile}' => $delivery->phone_mobile,

 

Before or after

 

            '{delivery_phone}' => $delivery->phone ? $delivery->phone : $delivery->phone_mobile,

 

 

Also insert -

 

            '{invoice_phone_mobile}' => $invoice->phone_mobile,

 

Before or after

 

            '{invoice_phone}' => $invoice->phone ? $invoice->phone : $invoice->phone_mobile,

 

 

 

Then in the BO go to - "Localization > Translations > Email templates translations" and edit "Emails for mailalerts module" as per below.

 

Delivery address

{delivery_block_html}

{delivery_phone_mobile}

 

 

Billing address

{invoice_block_html}

{invoice_phone_mobile}

 

 

You can also do this last part by editing "/themes/"theme"/modules/mailalerts/mails/en/new_order.html" as you require and re-uploading.

 

Hope this helps others...

Link to comment
Share on other sites

  • 5 years later...

Although its a 5 year old thread but it still helped. I had the same issue and this guide helped. Thanks man. (although some change in file name but it can be figured out)

If you are still here, is there a way to include Uploaded File in the emails similarly?

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...