Prestashop: send a 2nd confirmation email to a 2nd email address - email

I need to add an option in Prestashop(for instance by ticking a box) to send the confirmation order email to another email address, if it's a gift for instance.
I added an email field to my addresses table and forms, but I do not know how to get that value afterward and send the confirmation to the email input there, I tried adding a send::mail in PaymentModule.php, without success.
Do you have in workaround this problem ?

You can refer the validateOrder() function in PaymentModule.php classes as this function is responsible for creating the order and sending order confirmation email as well.

Related

Can I stop a SendGrid mail if it received a certain parameter?

I'm using a certain SendGrid template for several different projects and am trying to find a way to stop emails from going out in some conditions, through SendGrid.
For example, lets say I'm passing SendGrid some parameters like:
{id, name, amount, date}
I want to stop that email from going out when i'm passing a certain id.
I know that I can change the email template i'm sending with conditionals using handlebars:
From here
But Can I actually stop the mail if some condition happens?
In my case, every time I send the id = 5
You can control the body of the email using Handlebar templating, but by that point, you have already told SendGrid to send email with the data you provided. You cannot stop the email from being sent from within Handlebars.
If you're using code to tell SendGrid to send these emails, you could check in your code if the id equals 5, and if so, do not send an email.
If you're using Single Sends to send an email to SendGrid Contacts, you could to store this id field as a custom field, and create a segment or update your existing segment to filter out the contact with that id.

Adding new contact using mailgun in rails

I am trying to build app where users can subscribe for new updates.
My mailer is configurated with mailgun. Everything works fine except when I try to add new user with this method (as in official document): http://documentation.mailgun.com/user_manual.html#mailing-lists.
Honestly I have no idea how to send email adress from form directly to add_list_member(mail) without saving it to my database.
I will be grateful for any help!
Create two fields in your form
Name
Email
On Form's submission you send the input from the user to your backend for processing.
The backend takes the form's input, makes a few check to ensure the email is correct and not mispelled.
If the above is successful your backend pushes the email address and name to a mailing list, for reference that's something which you can create with the API or from the control panel (https://www.mailgun.com/cp/lists?domain=YOURDOMAIN.COM)
Then you just email the address provided in the email list

Email Salesforce

I m with a doubt with email, i have two objects an object call request where which request is related with an account.In the accounti have the email information, and in the"request" i have the fields that i need to write my email, so i create an email template where i bring the info from the object request, and now i want to send this email to contact in the account object.
And how do do a fluxe where it will send the email to my account with the information that i have in que other object.
Correct me if I'm wrong, the Email Address to which you want to send to is in the Account record and not in a Contact record associated to the Account, yes?
If so, using Standard Workflows, you only need to:
Create an Email field on your 'Request' object
Create a workflow that populates this new Email field equal to the Account Email Address upon creation/modification
Use this Email field to send an email.
Caveat: If the Email Address on the Account has changed, this won't fire off the workflow you created. You would need an Apex Trigger to achieve this.

PHPMailer or php mail function - show BCC address

I'm using PHPMailer to send mails to a clients database when certain events triggers. Obviously I don't want everyone to get the full list of client's emails, so i'm sending those in BCC using PHPMailer. It's working fine, but there is one problem.
The customer that receive the email got nothing in the field of the targeted email. Just blank. Shouldn't he be able to see his own address and own name I'm sending ? It's helpfull for people who are redirecting emails to know which was targeted.
Same goes with PHP native mail() function.
Is there a way to handle this ?
Thanks ahead !
No, that's not how BCC works.
If you receive an email via BCC, your mail client will show you the original recipient's address in the 'to' field, not yours.
This applies to all BCC mails; it has nothing to do with phpMailer.
If you want the recipients to see something in the 'to' field, you need to populate it with a dummy value -- for example, 'donotreply#yourdomain.com'.
It is good to send messages like this via BCC, so you're doing the right thing. But if you really want the end user to see his own email address in the 'to' field, then the only way to do it is to send the message to each user as a separate email, so you use the 'to' field and not 'bcc'. However, this will dramatically increase the load on your mail systems, so it's probably not the answer.
That's the nature of email. When a person is BCC'd, they will only see the To:, From: and CC: fields. The BCC field will hide every single email address, even the recipient's.
From wiki:
There are three ways in which the "BCC:" field is used.
In the first case, when a message containing a "BCC:" field is prepared to be sent, the "BCC:" line is removed even though all of the recipients (including those specified in the "BCC:" field) are sent a copy of the message.
In the second case, recipients specified in the "To:" and "CC:" lines each are sent a copy of the message with the "BCC:" line removed as above, but the recipients on the "BCC:" line get a separate copy of the message containing a "BCC:" line. (When there are multiple recipient addresses in the "BCC:" field, some implementations actually send a separate copy of the message to each recipient with a "BCC:" containing only the address of that particular recipient.)
Finally, since a "BCC:" field may contain no addresses, a "BCC:" field can be sent without any addresses indicating to the recipients that blind copies were sent to someone.

How can I hide the 'to' field in the email sent by php mail

I am using php mail function to allow user to send me a mail from
website.
I am also allowing them to "cc" the email to themselves.
The whole purpose of making a "send us message" feature was not give our email to the users. But when the user selects the "cc" option, in the header of the mail that is sent to the user, the "to" field contains our primary email address.
How can I remove this, so that the users do not see our primary email address in the to field.
You could set the mailTo to an arbitrary mailbox at your domain "noreply#yourdomain.com" and add your company address in BCC?
But whatever reason you have for not exposing your email, imho it's quite unpolite :)
The e-mail message sent to you must have a To: field to be delivered correctly. You could emulate the CC feature by sending to separate e-mail messages to the office and to the client.