Skip to content

Commit

Permalink
Merge 30e55b7 into f546889
Browse files Browse the repository at this point in the history
  • Loading branch information
rorJeremy committed Jan 31, 2019
2 parents f546889 + 30e55b7 commit 5732310
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
Expand Up @@ -3,7 +3,14 @@
class WCC::Contentful::App::ContactFormController < ApplicationController
def create
address = params[:email_object_id] ? email_address(email_model) : form_model.notification_email
form_model.send_email(form_params.merge!({ notification_email: address }))
form_model.send_email(
form_params.merge!(
{
notification_email: address,
internal_title: params[:internal_title]
}
)
)

render json: { type: 'success', message: "Thanks for reaching out. We'll be in touch soon!" }
end
Expand Down
Expand Up @@ -5,7 +5,7 @@ class ContactMailer < ::ApplicationMailer
def contact_form_email(to_email, data)
@form_data = data

mail(to: to_email, subject: 'Contact Us Form Submission')
mail(from: @form_data[:Email], to: to_email, subject: "#{@form_data[:internal_title]} Submission")
end
end
end
Expand Up @@ -10,6 +10,7 @@
data: { contact_form: true },
method: 'post' do %>
<input type="hidden" name="id" value="<%= section.id %>" />
<%= hidden_field_tag :internal_title, section.internal_title %>
<% if defined?(email_object_id) %>
<input
id="email-object-id"
Expand Down
Expand Up @@ -21,7 +21,7 @@ export = function (migration: Migration, { makeRequest, spaceId, accessToken })
required: true,
validations: [],
disabled: false,
omitted: true
omitted: false
})

sectionContactForm.createField('text', {
Expand Down
2 changes: 1 addition & 1 deletion wcc-contentful-app/spec/dummy/db/contentful-schema.json
Expand Up @@ -2531,7 +2531,7 @@
"required": true,
"validations": [],
"disabled": false,
"omitted": true
"omitted": false
},
{
"id": "text",
Expand Down
Expand Up @@ -1513,7 +1513,7 @@
"required": true,
"validations": [],
"disabled": false,
"omitted": true
"omitted": false
},
{
"id": "text",
Expand Down

0 comments on commit 5732310

Please sign in to comment.