Results 1 to 9 of 9

Thread: Add target to campaign

  1. #1
    ElgertS is offline Sugar Community Member
    Join Date
    Dec 1969
    Posts
    92

    Default Add target to campaign

    I have not had luck using the "Create Lead Form" functionality inserting leads, though it goes through the motions. I would like to make my own form to insert new targets and add them to a target list for a particular compaign. Can someone tell me what fields to populate to achieve this?

  2. #2
    Join Date
    Feb 2007
    Location
    San Jose, CA
    Posts
    1,169

    Default Re: Add target to campaign

    Hi there,

    I can give you a firsthand example of what I do to create the target list for the SugarForge newsletter every month. It's very simple:

    1. I'm importing my targets from an external source, a simple csv file that's created from a SQL statement from another database. The csv file just has "name" and "email address" as the two fields. Of course, if you had additional data, you could include it as well, but for my newsletters, that's all I need.

    2. Using the Import wizard, I identify the csv file and map the two fields. I map "name" to "last name" since I don't have an easy, reliable way of breaking apart the single string into a first and a last name; this doesn't matter much as I don't tend to use either the last or the whole name, though it's there for me to use.

    3. After importing the targets, I associate them with a target list that is associated with my campaign. When I send the newsletter, it picks up all the targets in my list.

    That's it. Done!

    Now you could create a form if you wanted with the info you need; I've found that just the simple CSV file is fine for my purposes, especially since I'm adding targets in bulk.

    Hope this helps.
    Susie Williams

  3. #3
    ElgertS is offline Sugar Community Member
    Join Date
    Dec 1969
    Posts
    92

    Default Re: Add target to campaign

    Thanks Susie!

    What I was after was to allow web visitors to add themselves to the newsletter one at a time. I actually finally found a reasonable way to get the "Create Lead Form" to work for me with my Joomla! website, but it is not ideal. I would rather use the Joomla! RAD tool Fabrik to insert the new values into the Sugar tables to add a new target to a campaign and to a target list. I then could easily integrate automated email response to the visitor, personalized response page and an email alert to me that they had been added and all staying within the my consistent Joomla! interface for the user.

  4. #4
    bradym80 is offline Sugar Community Member
    Join Date
    May 2007
    Posts
    36

    Default Re: Add target to campaign

    Quote Originally Posted by ElgertS
    Thanks Susie!

    What I was after was to allow web visitors to add themselves to the newsletter one at a time. I actually finally found a reasonable way to get the "Create Lead Form" to work for me with my Joomla! website, but it is not ideal. I would rather use the Joomla! RAD tool Fabrik to insert the new values into the Sugar tables to add a new target to a campaign and to a target list. I then could easily integrate automated email response to the visitor, personalized response page and an email alert to me that they had been added and all staying within the my consistent Joomla! interface for the user.
    Did you ever find a better solution? I am looking for the exact same thing. I am not interested in reimporting my list of recipients every time I send out a newsletter.

  5. #5
    sfgeorge is offline Member
    Join Date
    Aug 2007
    Posts
    5

    Smile Re: Add target to campaign

    I feel your pain, believe me I do. I'm a Sugar noob, and I'm just getting acquainted with the modules and api myself. But... good news, with a simple customization, I figured out how to assign a web lead to a target list.

    Disclaimer/request: I urge Sugar experts to please comment on this code.
    All: Do not use this in a production environment until it is endorsed by a Sugar veteran.
    The following code has only been tested in Sugar Open v4.5.1e


    Here's the 1-2-3 step by step...

    Step 1 - Customize WebToLeadCapture.php

    • Create a copy of WebToLeadCapture.php (in the root of your Sugar directory) - name the copy WebToLeadCapture-WithTarget.php
    • Find the following code (around line 82), and insert the red code between the green code below:

      Code:
          $lead->campaigns->add($camplog->id);
      
      //SFGEORGE - Begin target list assignment
          if (isset($_POST['prospect_list_id']) && !empty($_POST['prospect_list_id']))
          {
              //link prospect list and lead               
              $lead->load_relationship('prospect_lists');
              $lead->prospect_lists->add($_POST['prospect_list_id']);
          }
      //SFGEORGE - End target list assignment
      
          $lead->save();
    • Save changes to WebToLeadCapture-WithTarget.php.


    Step 2 - Determine the ID of your target list
    • Log-in on Sugar, and go to Campaigns.
    • Click on Target Lists, and click on the target list that you want your web leads to be assigned to.
    • Your browser's URL bar now contains the target list id. It is the value after record= and before &, such as in the URL below:

      http ://mysugarsite.com/index.php?action=DetailView &module=ProspectLists&record=af0f3e48-82a6-7557-2014-46d0362856f5&offset=3&stamp=1189061618017660400
    • My target list id was af0f3e48-82a6-7557-2014-46d0362856f5. Yours, of course, will be different. Copy it to your clipboard, you'll need it in this last step...



    Step 3 - Modify your web lead form
    • Open up your web lead form (or modify a copy, if you prefer).
    • Find the <form ...> tag, and change the form action from WebToLeadCapture.php to WebToLeadCapture-WithTarget.php.
    • Place the following html code within your <form> ... </form>. Make sure to replace the green text below with YOUR target list id.

      <input type="hidden" id="prospect_list_id" name="prospect_list_id" value="af0f3e48-82a6-7557-2014-46d0362856f5" />


    Good luck!

  6. #6
    chaos0815 is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    16

    Default Re: Add target to campaign

    Perfekt! Still works in 5.0.0d. Thanks alot!

  7. #7
    cafevino is offline Senior Member
    Join Date
    Dec 2009
    Location
    Fort Collins, CO
    Posts
    31

    Default Re: Add target to campaign

    That's pretty cool! But where would you put the code in 5.5? I noticed the code is different for the WebToLeadCapture.php file, with a permanent redirect to another file with an include, but I couldn't locate where to put the bit of code you gave us in any of the files. Any ideas?

    EDIT: I found a WebToLeadCapture.php file in the modules/Campaigns folder and found a spot to insert the code, but it gives me a "not a valid entry point" error. I'm assuming because 5.5 is set up differently than 4.x or 5.0. Anyone know how to get around that?
    Last edited by cafevino; 2010-02-03 at 08:59 PM.

  8. #8
    servnu is offline Junior Member
    Join Date
    Jun 2007
    Posts
    1

    Default Re: Add target to campaign

    How do you create that long ID in the 'id' field, if you are importing your prospects from a CSV file.

  9. #9
    barrybert is offline Senior Member
    Join Date
    May 2010
    Posts
    75

    Default Re: Add target to campaign

    Did you ever find a better solution? I am looking for the exact same thing.




Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HOW-TO guide for Email Campaigns.
    By agupta in forum Marketing/Campaign Management
    Replies: 146
    Last Post: 2012-01-31, 03:08 PM
  2. SugarSuite 4.0 - New Campaign management
    By manoj in forum Feature Requests
    Replies: 2
    Last Post: 2007-11-23, 10:13 PM
  3. Non-email campaign management
    By tomv in forum Feature Requests
    Replies: 0
    Last Post: 2006-06-05, 06:13 PM
  4. Missing Functionalities in SugarCRM 4.0.0 OS Version for Campaign Management
    By ravindram in forum Marketing/Campaign Management
    Replies: 1
    Last Post: 2006-05-16, 10:26 AM

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
  •