? ? ? Success

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
11 Jun 2014

This is an updated PR of #734

Add ability to add recipients for all emails sent through a com_contact form. A field is added to the parameters of the contact form for listing one or more email addresses to be added to the recipient list.

At times organizations want multiple email addresses to receive a copy of emails coming through a contact form. This could be a temporary assignment (such as when the contact person is on vacation), or it could be a on- or off-site account providing a backup or a log of all inquiries.

This feature adds the additional recipients through the form instead of through the contact's email field. Currently the field validation for com_contact does not allow for multiple email addresses, so this new feature respects that expectation (and a potential dependency).

The submitted implementation requests a comma to separate emails, but it also handles a semicolon as a valid separator. An invalidly-formed email address will not be included into the recipient list, but all preceding email addresses are successfully included. The implementation trims white spaces.

Detailed changes

  • Added two new fields (CC & BCC) to the com_contact configuration on the Form tab. These fields allow to set global email addresses that will receive ALL the emails sent to ANY contact.
  • Added two new fields (CC & BCC) to the com_contact contact form on the Form tab. These fields allow set email address that will receive ALL the email sent to this contact
  • Added two new fields (CC & BCC) to allow to override the contact CC & BCC fields on the views:
    • com_contact.categories
    • com_contact.category
    • com_contact.contact
    • com_contact.featured

Test instructions

  1. Modify the com_contact settings to add CC & BCC settings. These new settings will make that any contact form sent will send a copy to theses addresses.
  2. Add specific contact CC & BCC addresses on the contact form. This will send a copy to these addresses when any contact form is sent to this contact .
  3. Test contact CC & BCC overrides from any menu entry (com_contact.categories, com_contact.category, com_contact.contact, com_contact.featured). When a CC or BCC email is set on these menu entries any contact CC/BCC email addresses will be overriden.Global configuration CC&BCC emails must still receive the emails.
avatar phproberto phproberto - open - 11 Jun 2014
avatar brianteeman brianteeman - change - 8 Aug 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 16 Oct 2014
Category Components
avatar brianteeman brianteeman - change - 16 Oct 2014
The description was changed
avatar mbabker mbabker - change - 17 Oct 2014
Labels Added: ?
avatar ronnikc
ronnikc - comment - 17 Oct 2014

Starting to test

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar redcomponent redcomponent - test_item - 17 Oct 2014 - Tested unsuccessfully
avatar ronnikc
ronnikc - comment - 17 Oct 2014

Followed instructions and went to test the form - filled it out and hit send.

Got a blank screen upon hitting "Send" with no content in the source.

No emails where sent neither to the forfiller or main reciepent or additional reciepent.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar AnishaVora
AnishaVora - comment - 17 Oct 2014

@test,
got the blank page when filling up the contact form and hitting "send" button.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar AnishaVora AnishaVora - test_item - 17 Oct 2014 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 17 Oct 2014

@redcomponent @anishavora as a blank page is a php error page in disguise please can you enable maximum php error reporting and see if you can report back what the errors are. Thanks

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar JoomliC
JoomliC - comment - 17 Oct 2014

The params aren't loaded.

Adding $params = $app->getParams(); and it solves the issue of the blank page ;-)

avatar AnishaVora
AnishaVora - comment - 17 Oct 2014

Blank page error is solved.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar ronnikc
ronnikc - comment - 17 Oct 2014

Tries to reapply patch and test again but doesnt seem to be solved yet.

Getting:

Fatal error: Call to a member function get() on a non-object in /home/ronni/domains/gothard.dk/public_html/joomla/components/com_contact/controllers/contact.php on line 169

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar JoomliC
JoomliC - comment - 17 Oct 2014

@redcomponent, as the PR is not yet updated with the Note i've added, there's nothing changed in the patch.
You can add the $params = $app->getParams(); where i've added the note, to see if it's solving the blank page.
https://github.com/joomla/joomla-cms/pull/3757/files#r19013819

Cyril

avatar phproberto
phproberto - comment - 17 Oct 2014

It's not my PR. I just rebased it. I'll attach a commit now to fix some issues on it.

Thanks for testing!

avatar ronnikc
ronnikc - comment - 17 Oct 2014

I misunderstood Anisha's comment and thought it was ready to test again :)

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar phproberto
phproberto - comment - 17 Oct 2014

I think we can change it to use standard CC & BCC fields instead of the additional_recipients. I'm doing the changes now.

avatar yvesh yvesh - test_item - 17 Oct 2014 - Tested unsuccessfully
avatar yvesh
yvesh - comment - 17 Oct 2014

Aye params were missing. And there is already a way to add CC recipients (param always_copy_to), so probably you just keep them as additional recipients - even though i would prefer BCC.



This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3757.

avatar phproberto phproberto - reference | - 17 Oct 14
avatar phproberto
phproberto - comment - 17 Oct 2014

I updated the PR. I modified the behavior to use CC & BCC concepts that are better known by users and also allows us to send hidden email copies.

I have updated the PR description with the detailed changes and the testing instructions.

Summary:

  • Global com_contact config settings will be applied to any email sent to any contact and won't be overriden on any view/contact
  • Contact form settings will add CC & BCC recipients to form submissions to the edited contact
  • Specific menu CC & BCC settings will override contact CC & BCC settings. Never global settings.

I think it's easier to understand now the behavior and the workflow.

avatar phproberto phproberto - close - 17 Oct 2014
avatar phproberto phproberto - head_ref_deleted - 17 Oct 2014
avatar phproberto phproberto - close - 17 Oct 2014
avatar phproberto phproberto - change - 17 Oct 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-10-17 16:19:54
avatar phproberto phproberto - head_ref_restored - 17 Oct 2014
avatar phproberto phproberto - reopen - 17 Oct 2014
avatar phproberto phproberto - reopen - 17 Oct 2014
avatar phproberto phproberto - change - 17 Oct 2014
Status Closed New
avatar JoomliC
JoomliC - comment - 17 Oct 2014

addBCC() not working with only global options set (with or without CC, which one is working fine!), but addRecipient is...

Not sure to understand why to clone ?...

avatar phproberto
phproberto - comment - 17 Oct 2014

Not sure to understand why to clone ?...

Because if not the submit method is modifying the static JComponentHelper parameters (aka you cannot get the real component parameters because they have been overriden).

I'll test now the BCC

avatar phproberto
phproberto - comment - 17 Oct 2014

@JoomliC I just tested and here both work BCC & CC with only global config set. Do you mean that your contact has no email?

avatar JoomliC
JoomliC - comment - 17 Oct 2014

@phproberto Sorry, it's okay about BCC, it was a stupid error in my email address... !

After other tests, if i set BCC (the same for CC) in contact and in global options, BCC in contact don't receive the email. Is it the behaviour you want ?

avatar JoomliC
JoomliC - comment - 17 Oct 2014

After a better look...
We don't have the cc_recipients and bcc_recipients data from administrator/components/com_contact/models/forms/contact.xml
3 places for those settings :

  • menu [OK]
  • global [OK]
  • contact (params) [currently, we don't get the settings]

line 139 of contact.php controller, we can get all contact params, and not only show_email_copy

           $sent = $this->_sendEmail($data, $contact, $params); 

And then, line 179 :

   private function _sendEmail($data, $contact, $contact_params) 

This way, we can get show_email_copy, cc_recipients and bcc_recipients from the contact, and merge respectively to the $ccRecipients and $bccRecipients

avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar roland-d
roland-d - comment - 27 Feb 2015

@phproberto Can you comment on @JoomliC last question?

avatar zero-24
zero-24 - comment - 13 Mar 2015

@phproberto can you update to staging to fix the merge conflicts

avatar phproberto phproberto - change - 16 May 2015
Status New Closed
Closed_Date 2014-10-17 16:19:54 2015-05-16 12:26:35
Closed_By phproberto
avatar phproberto phproberto - close - 16 May 2015
avatar joomla-cms-bot joomla-cms-bot - close - 16 May 2015
avatar joomla-cms-bot joomla-cms-bot - change - 16 May 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment