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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • send email using API
Pages: [1]

Author Topic: send email using API  (Read 1896 times)

rshun

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
  • CiviCRM version: 4.2.1
  • CMS version: Drupal 7.21
  • MySQL version: 5.5
  • PHP version: 5.4
send email using API
March 15, 2013, 11:55:14 am
Hi,

  Is there any API to use sending out email?

Thanks,

R

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: send email using API
March 15, 2013, 04:41:35 pm

Currently no, but i suspect the API team would love to have an email API along with unit tests for this. Please contact the API team on IRC if you can help work on this

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: send email using API
March 17, 2013, 03:43:49 am
We would indeed love to have an email API! So if you are willing to undertake that work we would be worshipping at your feet  ;D (mild exaggeration). And of course be available to help you on IRC, just ask if anyone from the API team is around....
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: send email using API
March 17, 2013, 12:39:32 pm
Not helpful to your request but I should note there is one api function which does send emails - but only receipts for contributions.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: send email using API
March 17, 2013, 11:45:33 pm
So what would be the api for that?

api.email.send feels natural, but has nothing to do with the email entity
api.activity.sendemail is clunkier, but closer to what it does.

Should it allow to send any email or limit to using a template?

eg.
 param=array (from=>me,to=>array(eileen_id,erik_id),template_id=>42)
and/or
 param=array (from=>me,to=>array(eileen_id,erik_id),subject="warm beer",body=>"...")
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: send email using API
March 18, 2013, 01:42:08 am
Hmmmm api.email.send does sound logical for the function but does not fit into our naming convention
could we make it more generic so it would become something like api.message.send and we have a param which determines if it is mail or sms? Or am I rambling?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: send email using API
March 18, 2013, 06:57:05 am
Quote from: Erik Hommel on March 18, 2013, 01:42:08 am
could we make it more generic so it would become something like api.message.send and we have a param which determines if it is mail or sms?

Likely most of the constraints/param between mail and sms are different and will end up as different code anyway, probably not worthwhile trying to merge them.

Michael has worked on a sms sending and the chosen api was api.contact.sms

http://forum.civicrm.org/index.php?topic=26554.0

So going for an api.contact.email make sense and would be coherent IMO.

Quote
Or am I rambling?

I think the youngsters on the api team would call it tossing ideas around, but on the other hand, I'm way too polite to contradict an elderly member ;)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: send email using API
March 18, 2013, 07:43:43 am
Thankfully as an old member I am inpolite enough to offer him warm beer in return!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: send email using API
March 18, 2013, 08:26:02 am
Quiet in the cheap seats!

+1 for contact.email

It reflects the fact that contact tokens should be available
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: send email using API
March 23, 2013, 06:21:15 am
as a complete outsider contact.email feels right to me...

but more to the point I'd love to rewrite some custom legacy code to use the civicrm mailer

given my ignorance I maybe best served helping as an alpha tester and documenter?? especially if Eileen can find time to facilitate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • send email using API

This forum was archived on 2017-11-26.