-
Notifications
You must be signed in to change notification settings - Fork 0
Queued emails: Handle non-submission saving webforms and cleanup #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
37b46cb
to
dab8451
Compare
web/modules/custom/os2forms_queued_email/src/Plugin/AdvancedQueue/JobType/QueuedEmail.php
Outdated
Show resolved
Hide resolved
web/modules/custom/os2forms_queued_email/src/Plugin/AdvancedQueue/JobType/QueuedEmail.php
Show resolved
Hide resolved
web/modules/custom/os2forms_queued_email/src/Plugin/AdvancedQueue/JobType/QueuedEmail.php
Outdated
Show resolved
Hide resolved
|
||
// Remove OS2Forms attachments. | ||
foreach ($os2formsAttachmentFilenames as $os2formsAttachmentFilename) { | ||
unlink($os2formsAttachmentFilename); | ||
} | ||
|
||
$msg = sprintf('Email, %s, sent to %s. Webform id: %s.', $message['subject'], $message['to'], $submission->getWebform()->id()); | ||
$msg = sprintf('Email, %s, sent to %s. Webform id: %s.', $payload['subject'] ?? NULL, $payload['to'] ?? NULL, $payload['webformId'] ?? NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth moving this code before the file deletion to make sure that you only delete files if the job is succesful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With our current knowledge we assume that it is exactly these two lines that cause the sporadic issue, i.e. the 'stuckness' in the processing
state and subsequent re-processings. Moving this above deletion would result in subsequent job processes also sending emails.
Currently we have:
- Sporadic false-positive failed jobs, i.e. the mail is sent.
If we move the code we would have:
- Sporadic multiple emails sent
I'm not sure which is better.
https://leantime.itkdev.dk/tickets/showKanban#/tickets/showTicket/4308