Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Wanting to add new constant in email....

Wanting to add new constant in email....

Locked

Views: 1,011

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
1 Oct 2010, 8:04 PM
#1
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Wanting to add new constant in email....

I'm trying to customize the welcome email (and eventually other emails) sent by the system and need to add a couple of new constants. I have defined them in the includes/languages/english/<template>/create_account.php file. Do I have to modify the code in includes/modules/<template>/create_account.php as well? I can see the construct of building the email there.....just hoping there was a slightly easier way.

FYI- I'm running the Multi-Site mod and that's why I'm looking to make this type of modification. I need a background image, Store Name, etc. that changes based on the template.

Thanks in advance for the help.

1 Oct 2010, 9:12 PM
#2
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: Wanting to add new constant in email....

Actually, in looking at this closer, I'm not sure how the html markup from the email_template_welcome.html is being pulled into the email construct in the includes/modules/<template>/create_account.php file. I must be not seeing some piece of the puzzle here....

1 Oct 2010, 9:57 PM
#4
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: Wanting to add new constant in email....

OK, with a break and a new search term, I found this in the WIKI:
http://www.zen-cart.com/wiki/index.php/Customisation_-_E-mail_-_Format

So I went to the includes/modules/<template>/create_account.php file and added the following line (at line #388ish):

$html_msg['ID_TEXT'] = 'Use this ID every time you sign into Online Catholic Store';

(Of course, I'll use a constant once I get it working). Then in my email_template_welcome.html I have a reference to $ID_TEXT as seen here:

    <strong>$EMAIL_TO_ADDRESS</strong><br><br>
    $ID_TEXT<br><br>

But still no change....just seeing the reference to $ID_TEXT in the email.

Can anyone point out what I'm doing wrong?

Thanks!

1 Oct 2010, 10:11 PM
#5
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: Wanting to add new constant in email....

DrByte:

https://www.zen-cart.com/tutorials/index.php?article=113

Sorry, looks like we were posting at the same time. Thanks for that link but my problem is that I need to initiate a new constant within the html template.

1 Oct 2010, 10:24 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Wanting to add new constant in email....

pfabrick:

So I went to the includes/modules/<template>/create_account.php file and added the following line (at line #388ish):

$html_msg['ID_TEXT'] = 'Use this ID every time you sign into Online Catholic Store';

Then in my email_template_welcome.html I have a reference to $ID_TEXT as seen here:

    <strong>$EMAIL_TO_ADDRESS</strong><br><br>
    $ID_TEXT<br><br>That's the correct way.> **pfabrick:**

But still no change....just seeing the reference to $ID_TEXT in the email.Then you probably edited the wrong create_account.php file. ie: used the wrong override file. Or didn't actually upload the changes to the server. Or you've got multiple languages installed and it's picking up the wrong html file.

1 Oct 2010, 11:51 PM
#7
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: Wanting to add new constant in email....

DrByte:

That's the correct way.Then you probably edited the wrong create_account.php file. ie: used the wrong override file. Or didn't actually upload the changes to the server. Or you've got multiple languages installed and it's picking up the wrong html file.

Actually, it was all working but not showing up in the preview through the admin. Sent emails were working correctly and the constants were being replaced appropriately.

Now, after all the work I put into that email, I can't get the background image to get through to people's inboxes (not a ZC problem....it's the rendering in the email programs). A little google search found out I should have been using tables instead of divs....and I thought I was being clever for trying to do things the "correct" way.

Here's a link to the article on newsletter/email design practices that might help someone else avoid flushing so much work down the toliet!

reachcustomersonline.com/2010/01/23/09.27.00/?doing_wp_cron

Thanks for the help though!

2 Oct 2010, 4:29 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Wanting to add new constant in email....

Emails are best designed to HTML4 and CSS1 specifications, esp since microswift ain't so swift.