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

Refactor all emails to use Markdown views #3101

Closed
jbrooksuk opened this issue Jun 17, 2018 · 4 comments
Closed

Refactor all emails to use Markdown views #3101

jbrooksuk opened this issue Jun 17, 2018 · 4 comments
Milestone

Comments

@jbrooksuk
Copy link
Member

Replaces #3015


  • Every email should be Markdown based as this makes it very easy to implement any dynamically generated Markdown content.
  • Every email should contain Unsubscribe and Manage subscription links (this should be a partial).

This should be looked at as soon as #3100 is merged. It's even more important now that GDPR is live.

@nstapelbroek
Copy link
Contributor

After merging #3100 , these notifications need markdown support:

  • Notifications/Component/ComponentStatusChangedNotification.php
  • Notifications/IncidentUpdate/IncidentUpdatedNotification.php
  • Notifications/Schedule/NewScheduleNotification.php
  • Notifications/Subscriber/VerifySubscriptionNotification.php
  • Notifications/System/SystemTestNotification.php
  • Notifications/User/InviteUserNotification.php

@JamesWilson19947
Copy link
Contributor

JamesWilson19947 commented Oct 10, 2018

@jbrooksuk @nstapelbroek any ideas of when this will be implemented or if I can even do this?

It's basically the primary reason we cannot use it as a company, because without the consistent unsubscribe button on the emails, it's not GDPR compliant! :)

@JamesWilson19947
Copy link
Contributor

JamesWilson19947 commented Oct 10, 2018

I'm seriously cool with helping out with this work if you need! 👍
I just don't know exactly how you want the markdown example I made this for the update notifications:

In IncidentUpdatedNotification.php

return (new MailMessage())
                    ->subject(trans('notifications.incident.update.mail.subject'))
                    ->markdown('notifications.incident.update', [
                        'incident'               => $this->update->incident,
                        'content'                => $content,
                        'incidentName'           => $this->update->incident->name,
                        'newStatus'              => $this->update->human_status,
                        'unsubscribeText'        => trans('cachet.subscriber.unsubscribe'),
                        'unsubscribeUrl'         => cachet_route('subscribe.unsubscribe', $notifiable->verify_code),
                        'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'),
                        'manageSubscriptionUrl'  => cachet_route('subscribe.manage', $notifiable->verify_code),
                    ]);

update.blade.php

@component('mail::message')
# {{ trans('notifications.incident.update.mail.title', ['name' => $incidentName, 'new_status' => $newStatus])  }}

{{ $content }}

Thanks,<br>
{{ Config::get('setting.app_name') }}

@include('notifications.partials.subscription')

@endcomponent

Update:
I did the markdown for

  • Notifications/Component/ComponentStatusChangedNotification.php
  • Notifications/IncidentUpdate/IncidentUpdatedNotification.php
  • Notifications/Schedule/NewScheduleNotification.php

I haven't done the others yet, as they are less important! I'm happy to raise a pull request if you wish?

JamesWilson19947 added a commit to JamesWilson19947/Cachet that referenced this issue Oct 10, 2018
JamesWilson19947 added a commit to JamesWilson19947/Cachet that referenced this issue Oct 10, 2018
@jbrooksuk
Copy link
Member Author

Fixed in #3270

jbrooksuk added a commit that referenced this issue Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants