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

feat: notification unsubscribe & email overhaul with HTML multipart #3872

Merged
merged 61 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2e09b45
feat: notification unsubscribe links
imorland Aug 19, 2023
d247b40
Apply fixes from StyleCI
StyleCIBot Aug 19, 2023
cb1ccb7
use PHPStan array shape
imorland Aug 20, 2023
76604bb
remove docblocks
imorland Aug 20, 2023
79928b0
docblock types for UnsubscibeToken model
imorland Aug 20, 2023
5df7197
typo
imorland Aug 20, 2023
e1ab8e5
create setNotificationPreference on the User model
imorland Aug 20, 2023
ad4fc00
attempt to fix phpstan error
imorland Aug 20, 2023
c3ce914
Rename getEmailView to getEmailViews to better reflect the function. …
imorland Aug 20, 2023
c81c16e
check both plain and html views are provided to the mailer
imorland Aug 20, 2023
7bdb956
Apply fixes from StyleCI
StyleCIBot Aug 20, 2023
aed4336
add translations to UnsubscribeController
imorland Aug 20, 2023
500b726
remove commented code
imorland Aug 20, 2023
3b1b08b
phpstan possible fix?
imorland Aug 20, 2023
14c9284
unsubscribe via confirmation page and POST request
imorland Aug 21, 2023
7944a31
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
556544b
back to forum is now a hyperlink rather than button
imorland Aug 21, 2023
93441b7
remove commented code
imorland Aug 21, 2023
ace1804
refactor templates into either notification or informational
imorland Aug 21, 2023
c4c86a2
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
670a323
update path
imorland Aug 21, 2023
900cd73
extract greeting and handle globally
imorland Aug 21, 2023
b977caa
no need to pass displayname to translation anymore
imorland Aug 21, 2023
c281005
dont get the forum title twice!
imorland Aug 21, 2023
989624a
make displayname available to informational emails
imorland Aug 21, 2023
1325e0f
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
ecd99ca
format
imorland Aug 21, 2023
aa55d10
introduce translations to the plain templates (wip)
imorland Aug 21, 2023
f1e553e
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
0911f7a
fix typo of plain email view
imorland Aug 21, 2023
629eb9b
improve html email output readability
imorland Aug 21, 2023
98242c6
Begin breaking down html templates to allow for better control of the…
imorland Aug 21, 2023
0ea64f7
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
4171a02
allow config.php to specify outgoing mail format
imorland Aug 21, 2023
2971e01
Apply fixes from StyleCI
StyleCIBot Aug 21, 2023
cb7b302
add email signoff translation
imorland Aug 21, 2023
d2f3977
fix renderer issues
imorland Aug 21, 2023
87d4111
Include forum logo in html base template, if it's available
imorland Sep 13, 2023
feff34c
Update html notification templates
imorland Sep 13, 2023
bac74a7
Apply fixes from StyleCI
StyleCIBot Sep 13, 2023
3eac530
feedback: use formatter in blade templates, use post content renderer
imorland Sep 18, 2023
48224ff
chore: remove wip code
imorland Sep 18, 2023
c20540d
Apply fixes from StyleCI
StyleCIBot Sep 18, 2023
b0d688e
Update framework/core/src/Forum/Controller/UnsubscribeActionControlle…
imorland Sep 18, 2023
d3f4b5f
use markdown in email footer translations
imorland Sep 18, 2023
a3d6127
use markdown
imorland Sep 18, 2023
8356497
move mailer to mail namespace
imorland Sep 18, 2023
a60410b
Use combined type MailableInterface&BlueprintInterface
imorland Sep 18, 2023
6a1786f
Mail format config
imorland Sep 18, 2023
2b0352a
extract mail settings to ItemList
imorland Sep 18, 2023
9350518
use hasSection
imorland Sep 18, 2023
86b6089
phpstan error
imorland Sep 18, 2023
b31780b
stan, again
imorland Sep 18, 2023
0185c34
Merge branch '2.x' into im/unsubscribe-links
imorland Sep 18, 2023
6197de3
fix suspension not rendering the reason in html view
imorland Sep 18, 2023
b77e0a8
remove recipient_display_name
imorland Sep 18, 2023
55680c4
add mail_format to install step
imorland Sep 26, 2023
412a207
allow greeting or signoff to be disabled per template, or globally
imorland Sep 28, 2023
c4901f7
chore: re-use the existing information email job
SychO9 Sep 29, 2023
499f203
fix: allow disabling greeting from email blade template
SychO9 Sep 29, 2023
91da308
fix: error
SychO9 Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use markdown in email footer translations
  • Loading branch information
imorland committed Sep 18, 2023
commit d3f4b5fe9491fd3650e94a65b737ff136f031e11
12 changes: 7 additions & 5 deletions framework/core/locale/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -753,17 +753,19 @@ core:
# These translations are used by the "informational" email template.
informational:
default_title: "Information"
footer: "This email was sent to {userEmail} as an informational service related to your account on {forumTitle}."#
footer: "This email was sent to {userEmail} as an informational service related to your account on [{forumTitle}]({forumUrl})."
footer_plain: "This email was sent to {userEmail} as an informational service related to your account on {forumTitle}."

# These translations are used by the "notification" email template.
notification:
default_title: "Notification"
footer:
main_text: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on {forumTitle}."
unsubscribe_text: "If you'd like to stop receiving this type of notification, <a href=\"{unsubscribeLink}\">unsubscribe here</a>."
main_text: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on [{forumTitle}]({forumUrl})."
main_text_plain: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on {forumTitle}."
unsubscribe_text: "If you'd like to stop receiving this type of notification, [unsubscribe here]({unsubscribeLink})."
unsubscribe_text_plain: "If you'd like to stop receiving this type of notification, unsubscribe here: {unsubscribeLink}"
settings_text: "Manage your notification settings <a href=\"{settingsLink}\">here</a>."
settings_text_plain: "Manage your notification settings <a href=\"{settingsLink}\">here</a>."
settings_text: "Manage your notification settings [here]({settingsLink})."
settings_text_plain: "Manage your notification settings here: {settingsLink}"

# These translations are used in emails sent when users register new accounts.
activate_account:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
@endsection

@section('footer')
<p>{!! $translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumTitle' => '<a href="' . $url->to('forum')->base() . '">' . $settings->get('forum_title') . '</a>']) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumUrl' => $url->to('forum')->base(), 'forumTitle' => $settings->get('forum_title')])) !!}</p>
@endsection
6 changes: 3 additions & 3 deletions framework/core/views/email/html/notification/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@endsection

@section('footer')
<p>{!! $translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumTitle' => '<a href="' . $url->to('forum')->base() . '">' . $settings->get('forum_title') . '</a>']) !!}</p>
<p>{!! $translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink]) !!}</p>
<p>{!! $translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink]) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumUrl' => $url->to('forum')->base(), 'forumTitle' => $settings->get('forum_title')])) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink])) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink])) !!}</p>
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
@endsection

@section('footer')
{!! $translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumTitle' => $forumTitle]) !!}
{!! $translator->trans('core.email.informational.footer_plain', ['userEmail' => $userEmail, 'forumTitle' => $forumTitle]) !!}
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@endsection

@section('footer')
{!! $translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumTitle' => $forumTitle]) !!}
{!! $translator->trans('core.email.notification.footer.main_text_plain', ['email' => $user->email, 'type' => $type, 'forumTitle' => $forumTitle]) !!}

{!! $translator->trans('core.email.notification.footer.unsubscribe_text_plain', ['unsubscribeLink' => $unsubscribeLink]) !!}

Expand Down