Send email via the Mandrill API containing multiple BCC addresses - mailchimp

Is their any way to send email via the Mandrill API which contain multiple BCC address?
Mandrill API documentation displays only a single bcc_address in their API. So is it not possible send email which contain multiple BCC addresses?

Yup totally doable! According to the Mandrill API send documentation, you can specify multiple addresses in the to field, and mark them as type bcc.
Here's an example:
{
"to":[
{
"email":"recipient.email#example.com",
"name":"Recipient Name",
"type":"to"
},
{
"email":"bcc.recipient.email.1#example.com",
"name":"BCC Recipient Name 1",
"type":"bcc"
},
{
"email":"bcc.recipient.email.2#example.com",
"name":"BCC Recipient Name 2",
"type":"bcc"
}
]
}
Hope this helps.
Also make sure you're passing the value "preserve_recipients": true under the message section.

If you're trying to send an email to multiple users but don't want them to be able to see who you sent the email to, and not being able to "reply all", you can set preserveRecipients to false.
Source: http://help.mandrill.com/entries/21688056-Using-SMTP-Headers-to-customize-your-messages#preserve-recipient-headers-for-group-emails

Related

How to setup SMS delivery for Zoho Writer Merge+Sign API

I'm using Zoho writer merge and sign API to send the document for signature,
Everything works fine except that I cannot find in the documentation how to enable EMAIL + SMS delivery nor the format for providing recipient phone and country code and the document is only sent via EMAIL.
I tried formatting the signer like below, but it doesn't even add the phone and country code to the contact created inside Zoho Sign.
[
"recipient_1" => "test#email.com"
"recipient_name" => "Test Name"
"action_type" => "sign"
"recipient_phonenumber" => "123456789"
"recipient_countrycode" => "+61"
"language" => "en"
]
Appreciate if someone can advise how to achieve this.
Thanks

Shopping cart saved in firebase - order processing

my next question is about Firebase.
I have an application with spare parts for a car. In the application, a user authorized by email and password adds spare parts to his cart, which is stored in Firebase.
Question: how, by clicking the "submit order" button, send the contents of the cart to the seller (me) by mail?
Perhaps Firebase already has a ready-made solution / service for a similar task?
Does Apple's policy allow you to send the user's email address that was provided during registration for order feedback along with the request?
Here i trying to send order by MFMailComposeViewController
#IBAction func sendRequestButtonTapped(_ sender: UIButton) {
// Modify following variables with your text / recipient
let recipientEmail = "MyMail#gmail.com"
let subject = "description"
var body = "some array with ordered spare parts"
for i in objectsList {
body.append(i.objectFromPartsCatalogueListCode! + " " + i.objectFromPartsCatalogueListName!+"\n")
}
// Show default mail composer
if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self //!!!
mail.delegate = self //!!!
mail.setToRecipients([recipientEmail])
mail.setSubject(subject)
mail.setMessageBody(body, isHTML: false)
mail.modalPresentationStyle = .fullScreen
self.present(mail, animated: true)
// Show third party email composer if default Mail app is not present
} else if let emailUrl = SendEmailManager.createEmailUrl(to: recipientEmail, subject: subject, body: body) {
UIApplication.shared.open(emailUrl)
}
It is difficult and opens an additional menu for choosing the method of sending. I want to receive an order with content from the application on my mail, one click by the user of the "sendRequest" button.
You can easily send emails from your app via a secure backend environment (eg. cloud functions).
There are many possible solutions, but here is one of them:
When a user hits submit, you can create a new document in a special Firestore collection (eg. emails) and have a cloud function listening to changes in that collection using a background trigger Firestore event triggers. This function will get the document changes, retrieve its data (email information, and any other metadata you've specified), and send an email using whichever email API you decide to use (eg SendGrid).
Alternatively, you can use the Firebase email extension Extension, but writing your own function isn't difficult.
An added benefit is you can store your personal email in your secure backend environment so your users won't be able to access it on their devices.

Magento 2.3.3 Email Issue When Sending Email copy to multiple email

I am facing issue in the email in magento2. this issue is only faced in Magento 2.3.3.
How to produce
Go to
Store-> Configuration-> Sales-> Sales Emails -> Send Order Email Copy To -> enter multiple comma separated emails.
and change Send Order Email Copy Method BCC to separate Email
Now open any order and click on send an email you will get an error in
TypeError: Argument 1 passed to Magento\Email\Model\Template\Interceptor::setVars() must be of the type array, null given, called in /var/www/vendor/magento/framework/Mail/Template/TransportBuilder.php on line 368
have any one faced or fixed it??
I found a fix for it.
vendor/magento/module-sales/model/order/email/SenderBuilder.php
if (!empty($copyTo)) {
$this->configureEmailTemplate();
foreach ($copyTo as $email) {
$this->transportBuilder->addTo($email);
$transport = $this->transportBuilder->getTransport();
$transport->sendMessage();
replace above code as below
if (!empty($copyTo)) {
foreach ($copyTo as $email) {
$this->configureEmailTemplate();
$this->transportBuilder->addTo($email);
$transport = $this->transportBuilder->getTransport();
$transport->sendMessage();
Note: please dont do code in core file.

Sent Mail checking if it is delivered and open to recipient in Laravel

I want help in scaffolding code with Laravel default Mail package to send an email to the recipient with an enhancement that checks the status either mail is delivered to recipient and then check that either recipient opened the mail or not and then change the status of that email in my db_email_list. I googled it that to add headers just like follow the example but could not get it how to get the status
$message->getHeaders()->addTextHeader('X-Confirm-Reading-To','recipient_mail');
$sendEmail->getHeaders()->addTextHeader('Disposition-Notification-To','recipient_mail');
$sendEmail->getHeaders()->addTextHeader('Return-Receipt-To','recipient_mail');
When the user has gotten the email: Simply use this piece of code:
if (count(Mail::failures())) {
return false;
} else {
return true;
}
true=delivered, false=not delivered
When user reads the email: Hm sounds like you need to include a trick in your email in order to know if user has opened/read the email by simply adding for instance including an image on your email with a route defined in your end and passing user id as query param.
<img src="http://www.example.com/user-read-email?user_id=20" />
So whenever the user opens the email img src will fire a call to your url and simmply get the user id from the url, and set the flag for that user in db.

virtuemart 2 - how to send invoice as email attachment on confirm order

I want to send invoice as email attachment on order confirmation ,how to go about sending the invoice.
searched a lot ,not relevant data found.
The VM Order Confirmation Email work flow is as follows,
Check the function notifyCustomer() inside orders.php in administrator/components/com_virtuemart/models/
There is a section like shopFunctionsF::renderMail() It calls a function from shopefunctionsf helper file in /components/com_virtuemart/helpers/shopfunctionsf.php
renderMail() calls sendVmMail() in the same file there you can find option for attaching media or anything you want .
if (isset($view->mediaToSend)) {
foreach ((array)$view->mediaToSend as $media) {
//Todo test and such things.
$mailer->addAttachment($media);
}
}
Hope its helps..

Resources