Include mailer header logo on custom images list
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -1,5 +1,6 @@
|
|||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
helper :settings
|
helper :settings
|
||||||
|
helper :application
|
||||||
default from: "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>"
|
default from: "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>"
|
||||||
layout "mailer"
|
layout "mailer"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ class SiteCustomization::Image < ApplicationRecord
|
|||||||
"social_media_icon_twitter" => [246, 246],
|
"social_media_icon_twitter" => [246, 246],
|
||||||
"apple-touch-icon-200" => [200, 200],
|
"apple-touch-icon-200" => [200, 200],
|
||||||
"budget_execution_no_image" => [800, 600],
|
"budget_execution_no_image" => [800, 600],
|
||||||
"map" => [420, 500]
|
"map" => [420, 500],
|
||||||
|
"logo_email" => [400, 80]
|
||||||
}
|
}
|
||||||
|
|
||||||
has_attached_file :image
|
has_attached_file :image
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #dadfe1; padding: 20px 0;">
|
<td style="border-bottom: 1px solid #dadfe1; padding: 20px 0;">
|
||||||
<a href="#" target="_blank">
|
<a href="#" target="_blank">
|
||||||
<%= image_tag("logo_email.png", style: "border: 0; display: block; width: 100%;max-width: 370px", alt: setting["org_name"]) %>
|
<%= image_tag(image_path_for("logo_email.png"),
|
||||||
|
style: "border: 0;display: block;width: 100%;max-width: 400px",
|
||||||
|
alt: setting["org_name"]) %>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -72,6 +72,23 @@ feature "Admin custom images" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Image is replaced on admin newsletters" do
|
||||||
|
newsletter = create(:newsletter, segment_recipient: "all_users")
|
||||||
|
|
||||||
|
visit admin_site_customization_images_path
|
||||||
|
|
||||||
|
within("tr#image_logo_email") do
|
||||||
|
attach_file "site_customization_image_image", "spec/fixtures/files/logo_email_custom.png"
|
||||||
|
click_button "Update"
|
||||||
|
end
|
||||||
|
|
||||||
|
visit admin_newsletter_path(newsletter)
|
||||||
|
|
||||||
|
within(".newsletter-body-content") do
|
||||||
|
expect(page).to have_css("img[src*='logo_email_custom.png']")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Upload invalid image" do
|
scenario "Upload invalid image" do
|
||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
|
|||||||
BIN
spec/fixtures/files/logo_email_custom.png
vendored
Normal file
BIN
spec/fixtures/files/logo_email_custom.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Reference in New Issue
Block a user