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

feat(admin-email): improve management of contact info in emails #3070 #3378

Merged
merged 5 commits into from Jul 3, 2018

Conversation

Projects
None yet
4 participants
@Sidsector9
Member

Sidsector9 commented Jun 16, 2018

Closes #3070

Description

This PR adds a feature to add admin email address and offline mailing address in a common place. This makes it easier to export Give Settings from one URL and import it to a different URL without the need to manually change the admin email address, site URL, site name and the offline mailing address. More details can be found in the video below.

The following email tags are added in this feature:

  1. {admin_email}
  2. {offline_mailing_address}
  3. {site_url}

How Has This Been Tested?

By sending and previewing emails.

Video:

https://www.useloom.com/share/d9756dd20a874037bd9a15c8fa17c78c

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@Sidsector9 Sidsector9 changed the base branch from release/2.1.5 to release/2.2 Jun 16, 2018

$offline_address = give_get_option( 'contact_offline_mailing_address' );
if ( false === $offline_address ) {
return '<em>' . get_bloginfo( 'sitename' ) . '</em><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>111 Not A Real St.</em><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>Anytown, CA 12345 </em><br>';

This comment has been minimized.

@ravinderk

ravinderk Jun 19, 2018

Collaborator

@Sidsector9 use sprintf to format code

'id' => "contact_offline_mailing_address",
'desc' => __( 'Set the Offline Mailing Address. Use the {offline_mailing_address} tag to use this in the email templates.', 'give' ),
'type' => 'wysiwyg',
'default' => '&nbsp;&nbsp;&nbsp;&nbsp;<em>' . get_bloginfo( 'sitename' ) . '</em><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>111 Not A Real St.</em><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>Anytown, CA 12345 </em><br>',

This comment has been minimized.

@ravinderk

ravinderk Jun 19, 2018

Collaborator

@Sidsector9 I think we can use give_email_offline_mailing_address fn here instead of repeating data

@ravinderk

@Sidsector9 check review

__( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
get_bloginfo( 'url' ),
get_bloginfo( 'admin_email' )
__( 'Please click the link to access your donation history on {site_url}. If you did not request this email, please contact {admin_email}.', 'give' )

This comment has been minimized.

@ravinderk

ravinderk Jun 19, 2018

Collaborator

@Sidsector9 do we need sprintf here?

@kevinwhoffman

This comment has been minimized.

Member

kevinwhoffman commented Jun 20, 2018

@slewisma I wanted to give you a heads up that the three new email tags are coming in Give 2.2.0 based on your request:

{admin_email}
{offline_mailing_address}
{site_url}

You'll define the value of these fields in settings and the email tags will be used to pre-populate the templates. If you need to customize a specific form's email notification, you can of course remove the tag and enter your own content into the form's email content.

@Sidsector9

This comment has been minimized.

Member

Sidsector9 commented Jun 26, 2018

Call Summary

Participants: @DevinWalker @ravinderk and @Sidsector9
Topic: Changes to be made in the current PR
Result:

  • Rename from Contact to 'Contact Information'
  • Move tab from 'general' to 'emails'
  • Remove the custom admin email radios
  • Description for {admin_email} - By default, the {admin_email} tag will use your WordPress admin email. If you would like to customize this address you can do so in the field above.
  • Use placeholder for the admin email
  • tags in description should be in code tags
  • Description for {offline_mailing_address} - Set the mailing address to where you would like your donors to send their offline donations. This will customize the {offline_mailing_address} email tag for the Offline Donations payment gateway.
  • Double check if register_give_tags adds tags in the list

@DevinWalker DevinWalker merged commit 7bf3feb into release/2.2 Jul 3, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@DevinWalker DevinWalker deleted the issue/3070 branch Jul 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment