Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [Not a bug] Email Archive

[Not a bug] Email Archive

Locked

Started by niccol on 10 Nov 2010, 10:28 PM · Views: 1,406

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
10 Nov 2010, 10:28 PM
#1
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

[Not a bug] Email Archive

Not a bug really. More of a comment.

With a store set to send emails from only one domain, archived emails still have the from address as something else. Which just kind of means that the archive is not actually accurate.

So a 'tell-a-friend' email from [email protected] will appear in the archive as from [email protected] but actually be sent from [email protected].

Not a big deal but I think it would make more sense if the archive reflected the sent emails.

Nick
iszent.com

23 Nov 2010, 4:44 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: [Not a bug] Email Archive

I don't follow you.

The archiving process specifically stores the From address used when the email was prepared for sending.

.
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.

23 Nov 2010, 7:29 AM
#3
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: [Not a bug] Email Archive

In zen_mail :

$from_email_address is passed into the function which in the case of, for example, tell-a-friend is the email address of the customer.

Line 220 puts this into the mail object.

$mail->From     = $from_email_address;

Then a few lines later this is replaced with the store address if the setting in admin is to always use the store address.

But when the archiving is done the code reads:

zen_mail_archive_write($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, $email_html, $text, $module, $ErrorInfo );

So the original $from_email_address is used.

Which means that if the admin setting is to always use the store address then the email is sent from the store address but is archived as if the email has been sent from the customer. (Of course, the store owner should know that all emails are sent from the store address)

As I say it is a bit moot as to whether you might want to store that information anyway. But to me it seems that the archive should reflect the emails that are actually sent. So $mail->From should get passed into zen_mail_archive_write rather than $from_email_address.

But it is a minor point and I guess there is some advantage in storing the customer's email address here too.

Nick
iszent.com

23 Nov 2010, 7:42 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: [Not a bug] Email Archive

The reason why it doesn't store the alteration is because that alteration is done based on your choice to override the calculated settings and to use the server's rules instead.
You could always tell the server to not replace the From address with the store address, but then you run the risk of the server rejecting the emails because of its own internal rules. That issue could be mitigated by using SMTPAUTH as the transport method, in which case the switching isn't usually necessary.

There's no bug here to be fixed. It comes down to the rules established by the hosting configuration requirements.

.
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.

23 Nov 2010, 8:57 AM
#5
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: [Not a bug] Email Archive

As stated originally I didn't think it was a bug.

Yes, I understand the different transport methods. (I was having issues with tell-a-friend being filtered both at our mail server and other mail servers - which is how I came to find what I think is a inconsistency rather than a bug)

It comes down to the rules established by the hosting configuration requirements.

Well, no, actually it doesn't.

It comes down to whether Zen Cart writes the customers address into the database or writes the store address into the database.

If I choose 'Emails must send from known domain?' in email admin then zen_mail replaces the customers email with the store email when the mail is sent. It doesn't replace the customers email with the store email in the archive. I think this is inconsistent.

When I was trying to fault find the filtering issue and was changing between 'Emails must be sent from a known domain' being on and off I couldn't go back to the archive to see which emails had been sent with this setting on and which were sent with this setting off because in the archive they all show the from address as if the setting was off.

So, to say it another way the archive does not reflect if this setting is on or off. It doesn't record what the actual 'from address' of the email was. It records what the 'from address' of the email was before 'Emails must be sent from a known domain' is actioned.

But it really is no big deal...

Nick
iszent.com

23 Nov 2010, 9:13 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: [Not a bug] Email Archive

niccol:

So, to say it another way the archive does not reflect if this setting is on or off. It doesn't record what the actual 'from address' of the email was. It records what the 'from address' of the email was before 'Emails must be sent from a known domain' is actioned.Correct. It archives it as it was prepared to be sent, not how it was translated according to settings/preferences.> niccol:

But it really is no big deal...
Agreed.

.
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.