Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    selecting email recipients by classification

    I wasn't sure whether i would be better to post this in SQL or ASP, but here it is...

    I'm in the final stages of create a contact management database running on MS Access and ASP. In the database I have a table titled 'contacts'. We input contact info on each person and there is also a section of yes/no boxes to classify people based on their involvement with our organization. So some people may be classified in 2 groups, some people maybe 5 or 6.

    I also have an SMTP email page set up. For the email recipients section, I would like to provide users with either check boxes or a combo box (where more than one option can be selected) to select an individual 'group' or 'classification' to send the email to. Meaning I want them to be presented with the same view as they are presented with when adding a new contact to the database. There is no need for the users to select individual contacts as recipients, but rather check of or click GroupA, and/or GroupB, and/or GroupC....and so on.

    I would need to connect to the database first, but how do I code what I have mentioned above? As I said, I just want them to be presented with options for selecting each group name that would be recipients of the email. I can elaborate more if necessary.

    Thanks,
    Garrett

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I would make your "groups" (classifications) dynamic. Therefore if you have add new ones in the future it will automatically add them to each page. This can be done with either the database, or just a function with static options you add to one file.

    The options would be an array with the values of the "group" id. Then just loop through the options or some ASP equivalent function to implode(",", $group_ids); (PHP function) to put the values in a comma delimented variable.

    Then SELECT email FROM contacts WHERE group_id IN(".$group_ids.");

    Then do your loop through the results and do your email thing.

    Regards,
    Dennis

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dennis, thanks for the response. I see what you are saying about the dynamic group management, and in the "beefed up" version of this program I will go ahead with that. I am under a heavy time constraint to get this program up and running so we can import all of our contact info. Right now we have problems with our current contact management software that is creating nothing but headaches.

    I have gone into the access database and created a query with just an email column for each of the classifications of groups (meaning I have a query of those classified as GroupA, a query of GroupB, etc). I am hoping this will help some. Would you (or anyone out there) be able to help me more specifically with the code for it?

    I have the connection to the datbase open, no problem. I need to see how I can represent the query info with a variable as either query names in a combo box or a check box for each query. Meaning, I can select the query name from the list or check off the box for that email list query and it sends to all of the email addresses in the query.

    I'm not by any means an expert coder and it would take me days of trial and error (as I have done already) to understand some of this, although I'm working towards it and some day hope to be able to do so.

    I have tried forums specific to smtp, asp, and others, but everyone keeps telling me I need to get help from a coding forum, so here I am.

    Thanks

  • #4
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone out there? Was wondering if anyone had any more insight into this.

    Thanks for your help in advance


  •  

    Posting Permissions

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