Jump to content

CC with Prestashop Mail Class


acarr

Recommended Posts

I have a module that sends mail alerts when an order is marked as shipped which uses the Prestashop Mail class but i need to CC or even BCC the message to another address and the class doesn't seem to have the functions to do that - how is this usually achieved??

 

Thanks in advance

Link to comment
Share on other sites

the mail class needs to be overridden to add the support for cc or bcc. Then the module would have to be altered to include the address(es) to add to copy.

 

This is something I can build for you if you are looking to hire someone. Send me a PM if interested.

Link to comment
Share on other sites

Thanks for the offer, i'm fine doing the subclassing and adding the extra options to use the underlying swift functions but was hoping there was an easier way.

 

I actually find people with commercial interests swooping in on a developer forum disgusting btw and i haven't experienced it on the other forums i visit. As far as i was aware the purpose of places like this is to build a community of developers that can exchange information and learn together. If i wanted to just sub-contract all of my work i'm savvy enough to find people to do it.

Link to comment
Share on other sites

Hi acarr,

If you look at mail.php - send class, you can see that $to can be an array:

 

/* Construct multiple recipients list if needed */

if (is_array($to) && isset($to))

{

$to_list = new Swift_RecipientList();

foreach ($to as $key => $addr)

{

...

 

So if you don't mind that the recipients are all in the to field, not in a cc, then it's supported already. Just give the send module an array instead of a single string.

 

My 2 cents,

pascal

Link to comment
Share on other sites

I'll assume you overlooked the directional information I gave you regarding overriding the mail class and then revising the module.

 

Rather then attacking me for offering my services to you, you might have said thanks for the tip, or no thanks for your services, or perhaps asked for additional details on how to accomplish the task.

 

You might have even tried a search and would have stumbled onto a few existing topics... like this one

http://www.prestashop.com/forums/topic/29369-add-bcc-to-mailphp/

  • Like 1
Link to comment
Share on other sites

@PascalVG Thanks for that - i had noticed this but im going down the route of subclassing the Mail class and adding a call to setBcc() in swift.

 

@bellini13 Why would you assume that somebody posting a different idea would suggest that? I dont feel that i need to justify my pulling you up for offering your service - this is a developers forum, you're using it to pitch for work - its bad form in my book.

 

Anyway, putting that to one side, thanks for the link it was really useful.

Link to comment
Share on other sites

Thanks Bellini for that link. Didn't know that bcc option! :-)

 

Acarr, you seem knowledgeable in subclassing etc, I assume you will find your way to a final solution.

If so, shall we mark this topic as solved? (See my footer how to do this)

 

pascal

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...