Problem/Motivation

I have a registration scheduled action set to execute 1 minute after Registration completed and set the the registration type default state to 'complete'. The email isn't being sent because I cannot configure Cron to run frequently enough in my shared hosting environment. Can we get an immediate confirmation email option instead of using scheduled actions for this.

Comments

neubreed created an issue. See original summary.

john.oltman’s picture

Did you run cron after the registration was completed? You have to run cron to get the scheduled actions to execute.

neubreed’s picture

Hi there John. Yes I ran the cron and nothing happened.

john.oltman’s picture

I'm going to need more than this. Questions:
* Your install sends emails otherwise - like the password reset?
* You ran cron within one hour of the completion date/time?
* There is a valid email association with the registration?
* Anything in the logs?

selecta’s picture

How can i configure drupal to run cron right after a registration? My current setting is 3 hours and the fastest would be 1 hour.

But in general on the subject: It should be even faster than 1min. I don't understand why there can't be an immediate confirmation email.

thx

neubreed’s picture

Hi John. I think the problem was with my mail configuration. There was nothing in the logs to indicate that it failed to send. Only when the email was successfully sent.

I agree with selecta in that it would be great to have the scheduled action be triggered after a user registers. The hosting platform I use only runs the cron once an hour which I can't change unfortunately. An instant email confirmation is something that would be useful / common.

neubreed’s picture

Some further information ..

I've set the the registration schedule to 1 minute after Registration completed

Person registers at 05/26/2023 - 13:23

Multiple manual cron runs:

05/26/2023 - 13:30 Cron run completed.
05/26/2023 - 13:30
05/26/2023 - 13:30
05/26/2023 - 13:31
05/26/2023 - 13:31
05/26/2023 - 13:32
05/26/2023 - 13:32
05/26/2023 - 13:33
05/26/2023 - 13:34

registration_scheduled_action 05/26/2023 - 13:37 Sent registration confirmation email to matt@… neubreed
smtp 05/26/2023 - 13:37 Sending mail to: matt@.....com.au (…

john.oltman’s picture

Thanks for the additional info. Scheduled actions cannot be scheduled with greater frequency than Cron runs. The interface lets you do it since it doesn't know how often Cron will run, but the reality is if Cron runs every hour, then that is the highest frequency you can get on your actions. In a shared hosting environment, a confirmation message that comes an hour later isn't what you want, I get that. The D7 module had none of this functionality so this is all add-on for D10. You are right that an immediate confirmation would be preferred. I'm going to change this to a Feature Request and see what I can do on that.

john.oltman’s picture

Title: Registration schedule not firing » Immediate confirmation email for completed registrations
Version: 3.0.0-rc2 » 3.0.x-dev
Assigned: Unassigned » john.oltman
Category: Bug report » Feature request
john.oltman’s picture

Issue summary: View changes
john.oltman’s picture

Issue summary: View changes

  • john.oltman committed 74261421 on 3.0.x
    Issue #3361844: Send immediate confirmation email for completed...
john.oltman’s picture

Assigned: john.oltman » Unassigned
Status: Active » Fixed
john.oltman’s picture

Component: Registration Core » Registration Confirmation
neubreed’s picture

Hi John,

Thanks for working on this so quickly . I've had a play with the new submodule and my registration default state is set to "Complete" and I don't think the EventSubscriber onUpdate is executed when someone registers. If I login to the admin and edit the registration the onUpdate event subscriber is executed

if (($from_state !== $to_state) && $registration->isComplete()) {

By this point my from_state and to_state are both complete. So the email doesn't get sent

It would be good if the email gets sent on insert without admin intervention

john.oltman’s picture

@neubreed - I realized the same thing soon after my initial commit - and pushed up some fixes after that. If you grab the latest Dev branch, it will handle your use case now (on insert) without admin intervention.

Status: Fixed » Closed (fixed)

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