Results 1 to 4 of 4

Thread: Where is the relation between email addresses and the email address owner stored?

  1. #1
    rtedbyers is offline Member
    Join Date
    Nov 2010
    Posts
    14

    Default Where is the relation between email addresses and the email address owner stored?

    I have been trying to follow through on information Abazander and André Lopes kindly provided. However, I have been struggling because I have only passing acquaintance with PHP, Up until now, I have never written production code in PHP. Rather, I have written only simple scripts to, e.g. download financial data from yahoo or send emails. However, there is always more than one way to do things.

    Consequently, I have been looking at the sugar CRM schema and it seems to me to be relatively simple.

    From what I see, I can write code for a daemon in perl, that lives on the server (the code I was examining produces javascript living on the client) and queries the database to determine what meetings or tasks need reminders to be emailed, and it is easy also to determine who the meeting participants are or who is to complete a given task. I found the table with email addresses. What I haveen't found is the table that tells me which email address belongs to which user/lead/contact. So where is that relation stored?

    Thanks

    Ted

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Where is the relation between email addresses and the email address owner stored?

    The table is email_addr_bean_rel

    Actually the query you may want to write is:

    Code:
    SELECT a.id, a.name, ea.email_address FROM accounts AS a
    INNER JOIN email_addr_bean_rel AS eabr ON a.id = eabr.bean_id AND eabr.bean_module = 'Accounts' AND eabr.deleted = 0
    INNER JOIN email_addresses AS ea ON eabr.email_address_id = ea.id AND ea.deleted = 0
    WHERE a.deleted = 0

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    rtedbyers is offline Member
    Join Date
    Nov 2010
    Posts
    14

    Default Re: Where is the relation between email addresses and the email address owner stored?

    Thanks Andrei,

    The thing that threw me was the use of the string 'been',

    In any event, with this information, I can write a perl script that forms a daemon that checks every few minutes for meetings or tasks that warrant sending email reminders. That daemon would live on the server, and thus ends up having no interaction with the Sugar client code. It would operate strictly off the database.

    Thus, I can leave the existing reminder code unchanged (so the popup appears if the user in logged on) and they also get an email regardless of whether or not they're logged on. One way or another, they get a reminder that is almost certain to get their attention.

    I don't know if it is blasphemy to use Perl with Sugar, but as long as it works ...

    Thanks again

    Ted

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Where is the relation between email addresses and the email address owner stored?

    Quote Originally Posted by rtedbyers View Post
    Thanks Andrei,

    The thing that threw me was the use of the string 'been',

    In any event, with this information, I can write a perl script that forms a daemon that checks every few minutes for meetings or tasks that warrant sending email reminders. That daemon would live on the server, and thus ends up having no interaction with the Sugar client code. It would operate strictly off the database.

    Thus, I can leave the existing reminder code unchanged (so the popup appears if the user in logged on) and they also get an email regardless of whether or not they're logged on. One way or another, they get a reminder that is almost certain to get their attention.

    I don't know if it is blasphemy to use Perl with Sugar, but as long as it works ...

    Thanks again

    Ted


    Hi Ted

    Not a big deal accessing sugar through Perl.
    By the way I played Perl for a long time before starting working on SugarCRM. That is definitely a powerful language, specially regarding regular expression.

    Kind regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2010-08-10, 02:48 PM
  2. Replies: 2
    Last Post: 2010-03-31, 12:18 PM
  3. Replies: 2
    Last Post: 2008-10-15, 02:17 AM
  4. Replies: 2
    Last Post: 2008-04-01, 07:23 PM
  5. Replies: 1
    Last Post: 2006-04-26, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •