@mglaman and others - this module is exactly what I've been looking for. The Order Placed email template seems to work but the Checkout Completion Register isn't firing off any email. Am I understanding correctly that it should fire when a new user registers during checkout? If so, any ideas where to troubleshoot?

CommentFileSizeAuthor
#4 2020-06-10 09_41_54-Window.png26.59 KBdevnyc
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

devnyc created an issue. See original summary.

rszrama’s picture

Hmm, you're definitely interpreting the email event name properly, and the code seems to match up to the name of the core checkout event. Will try to reproduce in a vanilla environment, make sure there isn't something getting in the way.

rszrama’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

For what it's worth, I just tested this locally and the email sent fine. However, it does require the customer to actually register on the checkout completion page. In Commerce 2.x, that requires them to create a username and password, and upon submitting the form, they are logged in and the event is fired. Can you confirm?

devnyc’s picture

StatusFileSize
new26.59 KB

Ah - So I have the registration happen during the first checkout stage since we don’t allow guest checkout. I suppose I’d just need to modify the Checkout Completion example to fire on that stage of the checkout?

Thanks very much for checking it out.

rszrama’s picture

Title: Checkout Completion Email not being sent » Add EmailEvents for logging in or registering during checkout
Category: Support request » Feature request
Status: Postponed (maintainer needs more info) » Active

Ahh, interesting. Let's just repurpose this issue as a feature request to add an EmailEvent specifically for registration during checkout as opposed to registration after checkout completion. When we dig into it, this will require a patch to Commerce core, because we don't currently have Events for login or registration during checkout.

No promises on timeline, unfortunately, but you can always hook into the new account creation process itself to fire off that email via custom code in the meantime.

rszrama’s picture

We may also want to accommodate the new settings in Commerce 2.36 that support the automatic creation of a user account on checkout completion in this issue.

karengrey’s picture

Assigned: Unassigned » karengrey
Related issues: +#3388613: Create Event for registration during checkout

Created issue for Commerce Core to create the new Event for registration during checkout: https://www.drupal.org/project/commerce/issues/3388613

karengrey’s picture

Status: Active » Needs review

Once the Commerce Core issue has been committed, this MR will be unblocked and will add a new EmailEvent for registration during checkout.

vmarchuk’s picture

@rszrama
Note that when the commerce_checkout.checkout_register event is fired, the order has not yet been placed. So, certain information such as [commerce_order:total_paid] will not be available yet.
This is because in extractEntityFromEvent() we return the order but not the account that was just created. But in this case, we can get the account from the order [commerce_order:uid:entity] and also use some information available for the order. If we return the account, we will not be able to access the order information.
But it looks like the purpose of this issue is to work with the account, so probably we shouldn't think about the order and just return the account in extractEntityFromEvent()? And the order in the extractRelatedEntitiesFromEvent()?

  • vmarchuk committed b1317af4 on 8.x-1.x authored by karengrey
    Issue #3146682 Created new EmailEvent for registration during checkout.
    
vmarchuk’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.