Skip to content

Commit b351172

Browse files
committed
Add default signature for plain-text campaigns
1 parent 4e9dca7 commit b351172

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/keila/mailings/builder.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ defmodule Keila.Mailings.Builder do
144144
defp put_body(email, campaign = %{settings: %{type: :text}}, assigns) do
145145
body_with_signature =
146146
(campaign.text_body || "") <>
147-
"\n\n-- \n" <> (assigns["signature"] || HybridTemplate.signature())
147+
"\n\n-- \n" <> (assigns["signature"] || HybridTemplate.text_signature())
148148

149149
case render_liquid(body_with_signature, assigns) do
150150
{:ok, text_body} ->

lib/keila/templates/hybrid_template.ex

+11
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ defmodule Keila.Templates.HybridTemplate do
102102
Powered by [Keila - OpenSource Newsletters](https://www.keila.io/)
103103
"""
104104

105+
@text_signature """
106+
Unsubscribe:
107+
{{ unsubscribe_link }}
108+
109+
Tihs newsletter is powered by Keila: https://www.keila.io
110+
"""
111+
105112
@spec styles() :: Keila.Templates.Css.t()
106113
def styles() do
107114
@styles
@@ -130,4 +137,8 @@ defmodule Keila.Templates.HybridTemplate do
130137
def signature() do
131138
@signature
132139
end
140+
141+
def text_signature() do
142+
@text_signature
143+
end
133144
end

0 commit comments

Comments
 (0)