From d9a19a85b1a3ee3b74ffdf1b2b3dda1fb1ccb12c Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 27 Aug 2025 12:03:51 +0200 Subject: [PATCH] Add text templates counterparts for the bundle mailer --- .../mailers/notification/bundle_mailer/_footer.text.erb | 1 + .../mailers/notification/bundle_mailer/_header.text.erb | 1 + .../notification/bundle_mailer/_notification.text.erb | 6 ++++++ .../mailers/notification/bundle_mailer/event/_body.text.erb | 6 ++++++ .../notification/bundle_mailer/mention/_body.text.erb | 6 ++++++ .../notification/bundle_mailer/notification.text.erb | 5 ++++- 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 app/views/mailers/notification/bundle_mailer/_footer.text.erb create mode 100644 app/views/mailers/notification/bundle_mailer/_header.text.erb create mode 100644 app/views/mailers/notification/bundle_mailer/_notification.text.erb create mode 100644 app/views/mailers/notification/bundle_mailer/event/_body.text.erb create mode 100644 app/views/mailers/notification/bundle_mailer/mention/_body.text.erb diff --git a/app/views/mailers/notification/bundle_mailer/_footer.text.erb b/app/views/mailers/notification/bundle_mailer/_footer.text.erb new file mode 100644 index 000000000..6ab8bb14f --- /dev/null +++ b/app/views/mailers/notification/bundle_mailer/_footer.text.erb @@ -0,0 +1 @@ +<%= notification.creator.name %> \ No newline at end of file diff --git a/app/views/mailers/notification/bundle_mailer/_header.text.erb b/app/views/mailers/notification/bundle_mailer/_header.text.erb new file mode 100644 index 000000000..db036727d --- /dev/null +++ b/app/views/mailers/notification/bundle_mailer/_header.text.erb @@ -0,0 +1 @@ +#<%= notification.card.id %> | <%= notification.card.collection.name %> \ No newline at end of file diff --git a/app/views/mailers/notification/bundle_mailer/_notification.text.erb b/app/views/mailers/notification/bundle_mailer/_notification.text.erb new file mode 100644 index 000000000..fd96276ff --- /dev/null +++ b/app/views/mailers/notification/bundle_mailer/_notification.text.erb @@ -0,0 +1,6 @@ +================================================================================ +[<%= notification.creator.name %>] + +<%= render "notification/bundle_mailer/header", notification: notification %> +<%= render "notification/bundle_mailer/#{notification.source_type.underscore}/body", notification: notification %> +<%= render "notification/bundle_mailer/footer", notification: notification %> \ No newline at end of file diff --git a/app/views/mailers/notification/bundle_mailer/event/_body.text.erb b/app/views/mailers/notification/bundle_mailer/event/_body.text.erb new file mode 100644 index 000000000..c7db4eeec --- /dev/null +++ b/app/views/mailers/notification/bundle_mailer/event/_body.text.erb @@ -0,0 +1,6 @@ +<% event = notification.source %> + +<%= event_notification_title(event) %> +<%= notification_url(notification.source) %> + +<%= event_notification_body(event) %> \ No newline at end of file diff --git a/app/views/mailers/notification/bundle_mailer/mention/_body.text.erb b/app/views/mailers/notification/bundle_mailer/mention/_body.text.erb new file mode 100644 index 000000000..ae78b3671 --- /dev/null +++ b/app/views/mailers/notification/bundle_mailer/mention/_body.text.erb @@ -0,0 +1,6 @@ +<% mention = notification.source %> + +<%= mention.mentioner.first_name %> mentioned you +<%= notification_url(mention) %> + +<%= mention.source.mentionable_content.truncate(200) %> \ No newline at end of file diff --git a/app/views/mailers/notification/bundle_mailer/notification.text.erb b/app/views/mailers/notification/bundle_mailer/notification.text.erb index 8b7c8f424..c4c7c7c55 100644 --- a/app/views/mailers/notification/bundle_mailer/notification.text.erb +++ b/app/views/mailers/notification/bundle_mailer/notification.text.erb @@ -1 +1,4 @@ -PENDING... +Everything since <%= @bundle.starts_at.strftime("%-l%P on %A, %B %-d") %> +You have <%= pluralize @notifications.count, "new notification" %>. + +<%= render partial: "notification/bundle_mailer/notification", collection: @notifications, as: :notification %>