Skip to content

Improved presentation and documentation of email address in profiles

Monish Deb requested to merge github/fork/webmaster-cses-org-uk/patch-2 into master

Created by: webmaster-cses-org-uk

Update template templates\CRM\Grant\Form\Grant\Main.tpl to include check for $showMainEmail before rendering email-Primary field. This brings the template logic into line with the CRM core contribution form template.

Also added clarification in documentation that one profile should contain an email address field for best results.

This PR is intended to resolve https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/issues/174 and https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/issues/177.

Before

If an email field is included in a form profile, it is duplicated at the top of the form.

If no email field is included, a default field is rendered but this email address is then not displayed on the confirmation page.

After

If an email field is included in a form profile, the "built-in" email field is suppressed. This is consistent with standard CiviCRM contribution page behaviour (c.f. civicrm-core/templates/CRM/Contribute/Form/Contribution/Main.tpl).

Furthermore, there is no change to application logic (the code to calculate $showMainEmail already exists) - just a change to the presentation logic in the template to make use of it.

If an email field is included in a profile, this is then displayed correctly in the confirmation page.

Testing

Shown working on live CiviCRM installation 5.37.0.

Merge request reports

Loading