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

Add option for including all form data in email body #97

Merged
merged 3 commits into from
Oct 12, 2017
Merged

Add option for including all form data in email body #97

merged 3 commits into from
Oct 12, 2017

Conversation

nathanheffley
Copy link
Contributor

A simple toggle option that will include all the submitted data in the email message body. This is especially useful when sending the emails to a Gmail account which doesn't show the submitted email value (making the form almost useless at gathering contact info).

I attempted to add the German translation for the option with a mix of Google Translate and my rusty German skills, so a fix to make it more accurate/clear if it isn't already would be much appreciated.

$submission->message = $request->getBodyParam('message');

if ($settings->includeAllData) {
$submission->message = "<p>Name: {$request->getBodyParam('fromName')}</p>".
Copy link
Member

@brandonkelly brandonkelly Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message should be set to Markdown-formatted text, not HTML. Each of these <p>s should be regular lines of text, separated by two \ns. Or perhaps a bullet list would work better here (begin each line with a - and separate them with single \ns).

@@ -32,6 +32,11 @@ class Settings extends Model
public $allowAttachments = false;

/**
* @var bool
*/
public $includeAllData = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure a setting is necessary for this. I'm sure most people would be fine to have the additional info in the body.

@nathanheffley
Copy link
Contributor Author

nathanheffley commented Oct 11, 2017

I remove the option and just loaded all the data into the email body by default. Also changed the formatting to Markdown and put actual line breaks

@brandonkelly brandonkelly merged commit 2033bfc into craftcms:v2 Oct 12, 2017
brandonkelly added a commit that referenced this pull request Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants