Author Topic: Compare email to database records  (Read 3535 times)

Offline hirkadia

  • Newbie
  • *
  • Posts: 2
Compare email to database records
« on: April 12, 2013, 02:16:20 AM »
Hello,

Did anybody did some customization on the way the emails are sent because i want to compare the destination email to a list of emails in a database, the actual comparison will be done by another application and return something like "1" if the address is not in the database or an array in case of error via URL.

Can anybody point me in a direction because with trial and error is kind of hard. Thank you

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: Compare email to database records
« Reply #1 on: April 12, 2013, 02:18:46 AM »
I'm not sure I fully understand what your trying to do but you should be able to get the information you need with the plugin api: http://trac.marketingxp.com/wiki/Doc_Plugins

Offline hirkadia

  • Newbie
  • *
  • Posts: 2
Re: Compare email to database records
« Reply #2 on: April 12, 2013, 02:39:33 AM »
Hello,

Thank you very much for your quick reply. i will try to explain in a more structured manner. I have 2 applications. the first is the roundecube installation and the second is the application that will handle the email comparison. Below is the process i would like to take place.
- before sending an email roundcube will call via URL(or some method) the application which compares to a list of emails
- the application will compare the received email to a database with email addresses and return an answer (array or some kind of response to let roundcube know if to proceed with the sending of the email)
- roundecube will receive the answer from the application which compares email addresses and based on answer it will send or no the email

My thought process in PHP:

$response = //some way to call an url which returns and answer

  if($response && !is_array($response)) {
   //procede to send
  } else {
   //cancell the mail sending and return error message
   return $response['error'];
  }

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: Compare email to database records
« Reply #3 on: April 12, 2013, 02:56:27 AM »
You should be easily able to do that using the RoundCube plugin API using the message_outgoing_headers http://trac.marketingxp.com/wiki/Plugin_Hooks#message_outgoing_headers hook.