Commerce Core supports leaving admin comments on an order, but we offer no way for those to be emailed. It would be nice if instead of replicating settings in Commerce Core for email sending and / or formatting we could make use of Commerce Email to alter the option to trigger an email when an admin comment is created.

It would be simple enough to alter a checkbox into the admin comment form that says, "Email the customer a copy of this comment." and triggers an email event for Commerce Email to react to. However, as currently implemented, these email events are only capable of embedding tokens from entities related to the email event, and there are no such tokens for log entities.

We need to figure out either how to prepare tokens from a log entity based on either the full log message (or ideally individual tokens within the log template), or we need to find some other way to alter in custom replacement patterns when the mail is being sent, e.g., via hook_mail_alter().

Comments

rszrama created an issue.