-
Notifications
You must be signed in to change notification settings - Fork 834
Forms: plain text email reply #44790
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
base: trunk
Are you sure you want to change the base?
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
* @return array $lines | ||
*/ | ||
public static function get_compiled_form_for_email( $feedback_id, $form ) { | ||
public static function get_compiled_form_for_email( $feedback_id, $form, $urlencoded = false ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function returning "HTML" or "urlencoded array" is great and should not land in this format the PR, but it served as a quick demo.
We should be able to get "plain text" and "HTML" versions of form submissions, which then carries it all the way down to how file upload fields, multi line text fields etc get rendered.
Plain text can then be used to render plain text version of the full email as well, for those clients that instruct not to get HTML versions.
Then we can use plain text in emails and just wrap it in urlencode()
.
|
||
$actions = sprintf( | ||
'<table class="button_block" border="0" cellpadding="0" cellspacing="0" role="presentation"> | ||
'<table class="button_block" border="0" cellpadding="0" cellspacing="8" role="presentation"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this HTML table gets moved to HTML template, and actions becomes more lightweight; either just link tags or URL+label.
Now we're starting to split HTML layout in two different files which isn't great.
'?subject=' . | ||
rawurlencode( 'Re: ' . $subject ) . | ||
'&body=' . | ||
implode( '', $message_urlencoded ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to check for URL length limits here.
Code Coverage SummaryCoverage changed in 1 file.
|
Allow replying in plain text to form submissions, without including rest of the UI or links:
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: