Sending email by key to non-user In a custom plugin, I would like to use Craft's ability to register email message keys in order to keep emails consistent, and I would like to be able to send these emails to users as well as non-users. My understanding is that I would need to use the sendEmailByKey method of the EmailService to send emails using registered keys, which is defined like this:

public function sendEmailByKey(UserModel $user, $key, $variables = array())


This method only accepts a UserModel for the recipient, so it doesn't look like there's a way to send an email by key to an arbitrary email address. Is there a different way to send these registered emails to non-users?
Just because EmailService::sendEmailByKey() requires you to pass in a UserModel, doesn’t mean that the model has to represent an actual saved user. You can create one on the spot for them:

$user = new UserModel();
$user-&gt;email = 'sergster@abc.xyz';
$user-&gt;firstName = 'John'; // optional
$user-&gt;lastName = 'Doe'; // optional

craft()-&gt;email-&gt;sendEmailByKey($user, 'my_key', $variables);