Search code examples
ruby-on-railsrubyemailinfusionsoft

Infusionsoft send email method to add multiple cc_address or bcc_address


looking for a way to add multiple email_address in the cc_addresses in using infusionsoft ruby email_send method

I tried all following methods but none worked

1st try:

Infusionsoft.email_send([contact1,contact2],"[email protected]","[email protected]","'[email protected]','[email protected]'","","multipart","Testmail","","This the testmail")

2nd try:

Infusionsoft.email_send([contact1,contact2],"[email protected]","[email protected]",
['[email protected]','[email protected]'],"","multipart","Testmail","","This the testmail")

3rd try:

contacts = ["[email protected]","[email protected]"]

Infusionsoft.email_send([contact1,contact2],"[email protected]","[email protected]",
contacts ,"","multipart","Testmail","","This the testmail")

I want to send a mail to multiple users and a user who has received mail should be able to see the other contacts in the list as well.

Referring to rubydoc on infusionsoftgem


Solution

  • After All tires found answer

    Infusionsoft.email_send([contact1,contact2],"[email protected]","[email protected]","[email protected] [email protected]","","multipart","Testmail","","This the testmail")
    

    Adding email ids with no commas or double quotes for each and binding all email under double quotes with space worked good

    "[email protected] [email protected]"
    

    With that

    [contact1,contact2] 
    

    should contain all contact ids ,that has to be added in cc or to address without contact id the mail fails to deliver

    Above shown method works on both "to address" and "cc addresses"