Forums / General Questions / Help, I bought the Zencart book, but still need help!

Help, I bought the Zencart book, but still need help!

Locked

Views: 1,070

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
31 Oct 2009, 6:17 AM
#1
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Help, I bought the Zencart book, but still need help!

PLEASE HELP. I HAVE BOUGHT THE ZENCART BOOK, READ THE FORUMS AND I'M STILL VERY CONFUSED.

Most of our customers want HTML emails and I have a very nicely formatted email that is sent to them because of the email templates, specifically the checkout email.
I realize that the Plain Text folks are not going to get the same looking email. However, I seem to be unable to add some very important information to their emails because they aren't HTML. To get my nicely formatted HTML emails, I just added the text in the body of the email. However, that text doesn't show in plain text.

I believe I need to add a DEFINE to the email template and the language file. I really only know enough PHP to hurt myself, but I normally can do a search and figure out how to add things. So, I looked for " EMAIL_DETAILS_FOLLOW ' and found the places it was referenced in all files. Then, I did the following:

in the email_template_checkout.html, I added:
$EMAIL_UPLOAD_INFO

in the languages/english/mytemplate/checkout_process.php, I added:
Thank you for ordering from Photo-Calendars.com.
We appreciate your business and guarantee you will love your custom photo calendar. We will begin creating your calendar as soon as we receive your pictures, personal events, and captions. Before printing, we will email you a digital copy of your calendar for your review and approval. Please feel free to contact us by email or telephone with any questions.
(and a lot more details with some links.)

Well, none of that shows up on the emails. How do I add that Define to show up on my customers emails? Also, If I want that to show in HTML with line breaks < / br> and then in plain text with a line break, how do I do it?

thanks, Pam

Thanks.

31 Oct 2009, 6:33 AM
#2
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Help, I bought the Zencart book, but still need help!

I meant to say:

in the languages/english/mytemplate/checkout_process.php, I added:
define('EMAIL_UPLOAD_INFO', 'Thank you for ordering from Photo-Calendars.com.
We appreciate your business and guarantee you will love your custom photo calendar. We will begin creating your calendar as soon as we receive your pictures, personal events, and captions. Before printing, we will email you a digital copy of your calendar for your review and approval. Please feel free to contact us by email or telephone with any questions.');

(I noticed I left the define ... out. )

31 Oct 2009, 3:17 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: Help, I bought the Zencart book, but still need help!

Is there a particular reason why you wouldn't just replace the existing define('EMAIL_DETAILS_FOLLOW', xxxxxxxxxxx) with your new content?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Oct 2009, 4:36 PM
#4
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Help, I bought the Zencart book, but still need help!

Well, I guess because I haven't verified to see if that is the only email that uses that $EMAIL_DETAILS_FOLLOW if it is I guess I can do that.

However, I still need to know how to make it work to have it display right (line breaks). Also, won't the hyperlinks that are in the HTML email not work in the plain text?

Can you use the PDF file I have uploaded to:
http://aperfecthost-demo.biz/zencart/upload_order_demo.pdf
to show me how I would add it to that define? and how to make it look okay when it's in plain text? I know the header and the text won't show like that in plain text

Thank you.

(I'm still interested in learning how to add defines to the files like I mentioned so I can add it to my level of understanding. However, I really just need to make this email work. Thanks for the help!!)

31 Oct 2009, 7:45 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Help, I bought the Zencart book, but still need help!

I'd suggest putting it all in the EMAIL_DETAILS_FOLLOW define.

As for making line-breaks, use "\n\n" where you want a line break. The \n is a carriage-return (if inside double-quotes) and will be converted to a <br /> when used in HTML content.

As for A HREF hyperlinks, those will be deleted in the text-only emails. A workaround is to make sure the text used in making the hyperlink is the actual URL/link, and not merely descriptive text. ie: instead of <a href="url">description</a>, repeat the URL in the description: <a href="url">url</a> and add a description beside it instead.

I'm very reluctant to get into writing a full detailed tutorial on retrofitting many things into the v1.3.x email infrastructure since I've just finished rewriting the whole thing for the upcoming v2.0 where all the emails are in templates instead of language files ... meaning you'll have separate text-only and html-only templates which you can customize exactly as desired without having to touch any language defines at all.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Nov 2009, 8:52 PM
#6
christamcc avatar

christamcc

New Zenner

Join Date:
May 2008
Posts:
21
Plugin Contributions:
0

Re: Help, I bought the Zencart book, but still need help!

I was having the same problem (zencart 1.3.8a). I noticed that one part of the email was showing linebreaks correctly. So I borrowed that code.

Basically where ever str_replace('\n','', whatever) was used for email formatting I replaced in with nl2br(whatever); .

EXAMPLES:
WAS:
str_replace('\n','',EMAIL_WELCOME);
NOW IS:
nl2br(EMAIL_WELCOME);

WAS:
str_replace('\n','',EMAIL_TEXT);
NOW IS:
nl2br(EMAIL_TEXT);

That seemed to work!

(You can do a search for EMAIL_WELCOME or EMAIL_TEXT to get you near the right code)