i got we are in the conditional first and then no extra again when I changed the second.
i got we are in the conditional first and then no extra again when I changed the second.
The full-time Zen Cart Guru. WizTech4ZC.com
i'm sorry. i do not understand what you are saying here.
as i wrote in a since deleted blog post, email is hard.
i have tested the code above, and based on my tests, assuming we get inside the conditional, this does code work on my server.
one thing i have noticed, is that if your bcc is the same as your to, in gmail, it looks like they will only deliver 1 email.
if you want to test using my email address in the bcc, feel free. i will pm you my email address.
if it does not work, we would have to look at the email logs on the server; as well as the version of phpMailer you are running. ZC156 looks to be running phpMailer 6.0.7. while ZC157 looks to be running 6.3.
best.
The first conditional did display in the logs - "we are in the conditional" but second did not.
I just upgraded the phpmailer - lastest is 6.5. Still no joy
And yes using a separate email address.
The full-time Zen Cart Guru. WizTech4ZC.com
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
hi mc,
i'm currently exploring this problem further. to start with, this is a v156c install. the notifier parms have changed:
looked at the includes/functions/functions_email.php. if we look at this line in v157:
https://github.com/zencart/zencart/b...email.php#L283
and compare it to the v156 version,
https://github.com/zencart/zencart/b...email.php#L274
you can see the v157 has 2 extra parameters added to it. one of which is the parameter we need.
i think that's the only problem.
best.
I was just going to identify based on similar review that likely need to be considering the notifier: NOTIFY_EMAIL_READY_TO_SEND
As it is the first notifier that has $mail available for edit. Though the other question becomes does the vendor need the customer provided email only or does it need to receive the additional information that the admin can/does receive.
While here, might as well update the earlier post about using the auto-loading observer. That option was added and has been available since and including Zen Cart 1.5.3. So the observer class used here could be of the auto-loading variety for this 1.5.6 site.
Last edited by mc12345678; 2 Jul 2021 at 07:50 PM.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
mc,
i changed it to the other observer; i like that one and should have looked at that a little closer.
in addition, this code needs to be changed:
capital S in Subject.PHP Code:
// from:
if ((strpos($p2->subject, 'Order Confirmation') !== false) && (strpos($p2->subject, 'NEW ORDER') === false)) {
//to:
if ((strpos($p2->Subject, 'Order Confirmation') !== false) && (strpos($p2->Subject, 'NEW ORDER') === false)) {
surprised you missed that one!
I'm not :) I was still back on the what the subject line was expected to contain. :) wouldn't it be "better" to use or obtain the define that provides that text rather than entering the text specifically? (now thinking also of multi-language situation) of course would also want to try to account for the empty define condition, but in reality seems like would probably want to observe some other upstream action, set an internal observer variable and then check for that variable being set, take the action and possibly clear that variable if it is possible/desired to do the action again.
In this way the above code is not dependent on content but intent. Just a thought. :) Would offer up a notifier if I had a better understanding of the action(s)/condition(s) expected to trigger this bcc condition and took a moment to look through the code.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
i thought about it.... but i was unsure if the define would be available (obviously i think it would be); but it is a 1 off, and i think hard coding in this situation is fine.
setting an upstream internal observer var and then clearing it seems like a lot of work with potential for problems. but an interesting idea none-the-less. in fact, i did something similar here:
https://www.zen-cart.com/downloads.php?do=file&id=2292
so maybe not so much work. but interesting to think about.
Bookmarks