Using mail function i am send mails to multiple users with comma separated values in Drupal 8. But in that mail id users, some users selected mail preference as html and some users selected plain-text settings. So how can i send the html/plain-text mails programatically based on users settings?

  • You'll have to send the emails in a loop instead
    – Clive
    Jun 28, 2016 at 10:03

1 Answer 1


If we are talking about hardcoding (not interface), you have to loop through the
addressee list, load that user, and based on his preferences send html, or plain text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.