Skip to content
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

Disable mailing (cherry picked upstream PR) #49

Merged
merged 4 commits into from
Nov 28, 2024

Conversation

thlehmann-ionos
Copy link

@thlehmann-ionos thlehmann-ionos commented Oct 29, 2024

Upstream PR: nextcloud#48977

Approach discussed with Louis Chemineau.

Summary

If mails ought to be send by other means than rendering messages from
templates and sending them via SMTP-like protocols.

Use-case example

Listening to specific Nextcloud events and pass parameters to a centralized (i.e. REST-based) API that sends e-mails.

Background why not ...

  • customize mail templates: mails should not be delivered by SMTP-like protocols and rendering messages that will never be send is unneeded overhead
  • implement template class and set mail_template_class: same as before
  • listen for BeforeMessageSent and act upon that: would be an option, but it would still render messages that will never be sent and the template data might also have to be enriched with custom information (i.e. in our case the sender's user ID, not their e-mail address)

@thlehmann-ionos thlehmann-ionos changed the base branch from master to ionos-dev October 29, 2024 12:43
@thlehmann-ionos thlehmann-ionos changed the title Tl/dev/disable mailing cherry picked Disable mailing (cherry picked upstream PR) Oct 29, 2024
@thlehmann-ionos thlehmann-ionos force-pushed the tl/dev/disable-mailing-cherry-picked branch from fcccc0f to 0519937 Compare November 7, 2024 10:13
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@thlehmann-ionos thlehmann-ionos force-pushed the tl/dev/disable-mailing-cherry-picked branch from 0519937 to c9d9ffa Compare November 14, 2024 14:29
@thlehmann-ionos
Copy link
Author

Upstream PR nextcloud#48977 got accepted. Final commits cherry-picked here.

@thlehmann-ionos
Copy link
Author

Needs config: IONOS-Productivity/nc-config#32

@thlehmann-ionos thlehmann-ionos force-pushed the tl/dev/disable-mailing-cherry-picked branch from c9d9ffa to 1de00e3 Compare November 14, 2024 16:33
@printminion-co printminion-co marked this pull request as ready for review November 15, 2024 15:53
@printminion-co printminion-co self-requested a review November 15, 2024 15:54
Currently $this->instance is never set, so the code is no-op. This
brings back caching of the instance.

Caching broke with

   be7db15

   Swift to \Swift_Mailer as abstraction

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
The IDE hinted the value is immediately overwritten.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
== Goal

Allow disabling mail delivery altogether.

== Usecase

If mails ought to be send by other means than rendering messages from
templates and sending them via SMTP-like protocols.

Example: listening to specific Nextcloud events and pass parameters to
a centralized (i.e. REST-based) API that sends e-mails.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
When the mail transport is configured as null transport, the
configuration UI would not work.

== Background

The null transport is meant for situations where operators
implement mail delivery via custom mechanisms like REST APIs.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
@printminion-co printminion-co force-pushed the tl/dev/disable-mailing-cherry-picked branch from f21f9c9 to 969055b Compare November 28, 2024 14:36
Copy link

@printminion-co printminion-co left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review ok.. ..jus changed the " on ' in two file in order to be same with nextcloud#48977

@printminion-co printminion-co merged commit 83c6dc5 into ionos-dev Nov 28, 2024
4 of 5 checks passed
@printminion-co printminion-co deleted the tl/dev/disable-mailing-cherry-picked branch November 28, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants