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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to create a cron job to get pdf letters of contacts with upcoming birthdays
Pages: 1 [2]

Author Topic: how to create a cron job to get pdf letters of contacts with upcoming birthdays  (Read 1832 times)

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: how to create a cron job to get pdf letters of contacts with upcoming birthdays
July 12, 2012, 10:11:22 am

that code (along with most of civi code) gets most of its information from the form and is not "independent".

Over time we are factoring things out, so they can be invoked via an API too

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

bendev

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: how to create a cron job to get pdf letters of contacts with upcoming birthdays
July 12, 2012, 11:40:10 am
Is it possible to populate this form manually ? to prepare it for the civicrm class & methods ?

if not, is the task PDF already supported by the API ?

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: how to create a cron job to get pdf letters of contacts with upcoming birthdays
July 12, 2012, 02:27:51 pm

1. possibly, but i dont think its worth the effort, IMO

2. no

i think the best path forward would be to restrucure the code in /CRM/Contact/Form/Task/PDFLetterCommon.php to be form independent. i.e potentially push most of the work to CRM/Contact/BAO/PDF.php or something like that

if you'd like to pursue this, please ping us on irc and we can help u get started

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: how to create a cron job to get pdf letters of contacts with upcoming birthdays
July 12, 2012, 04:47:38 pm
That's really easy to extend the api with a getbirthday

Create the function civicrm_api3_contact_getbirthday into Contact/GetBirthday and you have it available

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

bendev

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: how to create a cron job to get pdf letters of contacts with upcoming birthdays
July 13, 2012, 12:52:30 am
Hello Xavier,

Yes I agree this is easy but this is not what I am looking for.

I want to perform the task to print PDF letter to these contacts that have their birthday in the coming month.
This should be done programmatically (in order to be launched from a cron)...

I search how I could reuse the already defined methods and class...


Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to create a cron job to get pdf letters of contacts with upcoming birthdays

This forum was archived on 2017-11-26.