Closed SolisInfotech closed 2 years ago
I've replied via email about this, but the main suggestion to handle this is to use events https://concrete5-community-store.github.io/community_store/developers/events.html Those can be fired after the payment has been made, and can programmatically do whatever you like, including sending emails.
This is an example of using an event and sending email, but for when fulfilment statuses change: https://github.com/concrete5-community-store/community_store_fulfilment_notifications It might act as solid boilerplate for 90% of what you'd need to code.
Thanks for getting back to me, I do really appreciate it.
I will look at these areas and see how they interact with the cart and email.
I did end up ‘sorting’ it at 1am…. I purposely broke the receipt mail template, causing php to error our, and of course, I had a whole back track of the process up to the error showing files paths, line numbers etc.
That showed the mail is configured and hooks the templates from the Orders.php file , and editing that we get exactly what we need – in fact I don’t BCC I ended up generating a new email direct to Trustpilot using only a small set of data rather than sending the entire order copy.
I will update my query on github to say what I did.
Great bit of software for our level of requirement – we also run Magento and Sellerdeck sites too, its all fun and games eh?
Sincerely,
Andy Warner
Great to hear you tracked down the flow.
I think the main thing I'd stress is the danger of editing a core add-on file (or core concrete5 file), to achieve what you are wanting. It's the whole issue of then having to track these customisations as you perform updates.
You're description of creating a new email with a subset of data is specifically what I'm suggesting, but instead of doing it directly in Order.php, you would do it in your own add-on, through an event.
If you've got the email worked out, you should actually be able to cut and paste that out, and put that into the event handling. Worth investigating longer term.
Hi folks, I wanted to add a Trustpilot 'review request' to order emails. It requires a BCC in the 'order confirmation' emil, to be set to a trustpilot address. I've no idea where to look to add this - i can find the email templates (and can update $subject, but cant add things like $bcc etc and I cant find the php that generates the email and pulls the template in, ive literally no idea where to look, despite hours of google-fu. Then i thought, you guys could probably add this kind of function with your eyes closed..... hence the feature request.