Forums / Contribution-Writing Guidelines / Sending multiple emails using zen_mail

Sending multiple emails using zen_mail

Started by retched on 30 May 2012, 10:18 PM · Views: 2,888

Results 1 to 4 of 4
30 May 2012, 10:18 PM
#1
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Sending multiple emails using zen_mail

Hi,

I'm trying to invoke zen_mail twice so that I can send an email to myself (admin) and my customer. I'm using the following to invoke it but I cannot seem to get it to work. When I do call it, it causes the emails not to send out. Can anyone help?

      zen_mail($customer['customers_firstname'] . " " . $customer['customers_lastname'],
           $admin,
           $subject,
           $text,
           TITLE,
           $admin['admin_email'],
           $block,
           $module_used
           );
31 May 2012, 3:26 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Sending multiple emails using zen_mail

Please explain again the "why" behind your question.
And what business problem you're trying to solve.
And why you arrived at this approach as being your "solution".
And are you trying to send 2 emails "at the same time", ie: a "cc" or "bcc"? or simply re-send the identical email to another recipient?

.
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 Jun 2012, 8:35 PM
#3
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: Sending multiple emails using zen_mail

DrByte:

Please explain again the "why" behind your question.
And what business problem you're trying to solve.
And why you arrived at this approach as being your "solution".
And are you trying to send 2 emails "at the same time", ie: a "cc" or "bcc"? or simply re-send the identical email to another recipient?

For the SnapAffiliates module currently there is a message sent whenever someone is paid. I want to also have that same email sent to the person who is processing the transactions as well. This message will be sent as a BCC as to protect the privacy of the address of the person sending it.

2 Jun 2012, 9:17 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Sending multiple emails using zen_mail

Your simplest solution is to copy the existing line (or 2 lines if it's so long that it's split onto multiple lines) for the current call to zen_mail() and paste it again right below the existing one, and simply supply the new email address in place of the customer's email address.
That way it'll send the normal email to the customer, and then immediately send another identical email to the staff person.
No bcc configuration required. Just call zen_mail() a second time with a new email address.

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