CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How can I change the mail from address to the contact's address who sends it
Pages: [1]

Author Topic: How can I change the mail from address to the contact's address who sends it  (Read 709 times)

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
How can I change the mail from address to the contact's address who sends it
November 16, 2012, 07:00:39 am
The hook_civicrm_alterMailParams( &$params ) can only change the from address globally.

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: How can I change the mail from address to the contact's address who sends it
November 18, 2012, 04:51:55 pm
I have done some work similar to this, and it requires some small modifications to core, which I save in customphp and customtpl folders.

Basically, we send out e-mails from our main organization bulk-mail e-mail account, that also handles all bounce processing and reply tracking in civicrm (say no-reply@example.org).

However, the reply to address is set to the e-mail address of the sending user (they have a drop down menu of all e-mail addresses on their contact record). This means we only need to setup one 'From' email address, and that all mailings can be effectively tracked, but that replies can be easily directed to those who sent the original mailing.

I plan to, but haven't done it yet, tried changing the From name to the sending user, while keeping the from address. So for example, instead of 'Example Org <no-reply@example.org>', the mail could be sent as 'Brian, Example Org <no-reply@example.org>'.

Is that what you are looking for? I can share tomorrow when back in front of my computer.

Brian

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: How can I change the mail from address to the contact's address who sends it
November 18, 2012, 10:26:33 pm
Exciting!

But the mail sent here, when I click reply, it still shows the the 'no-replay@example.org', the default mail, not the sender mail.

I want to the from and reply all be sender's mail.  How can I do this, really needs help!! Thanks!

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: How can I change the mail from address to the contact's address who sends it
November 19, 2012, 10:24:34 am
Use Administer - Civimail - From Email Addresses to set up emails for each person who will be sending via Civimail. You can then choose the individual sender's email in the Reply to box. Is that what you're after? Apologies if I misread your post and you're trying to do something far more complicated than that!



 

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: How can I change the mail from address to the contact's address who sends it
November 20, 2012, 03:26:30 am
it would be helpful if you could be more specific about what mailing you are talking about and how it is getting sent (administrator using the civicrm back end, self service via the front end, civimail, etc.) since the answer is likely to be different in each case.

Quote
The hook_civicrm_alterMailParams( &$params ) can only change the from address globally.
that hook will be fired in the context of the person sending the mailing so I would have thought that you can get the logged in person from the session and then change the from email to the person that was logged in when that happened.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How can I change the mail from address to the contact's address who sends it

This forum was archived on 2017-11-26.