Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2008, 11:59 PM
citricguy citricguy is offline
 
Join Date: Jun 2005
Location: Maui, Hawaii
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBulletin and Interspire Email Marketer (SendStudio)

I'm very new to almost everything I have done below so bare with me.. What I'm trying to do is add a confirmed user account to an Interspire Email Marketer list upon successful+confirmed registrations.

1) The code works 60% of the time.
2) I have no idea why.

Any help with reliability/code or anything would be greatly appriciated. I'm very new to this stuff.

I'm triggering the XML post (ala: http://idn.interspire.com/articles/2...1.html#request ) to add new users after they successfully subscribe.

Plugin hook: registration_activate_process

And here is the plugin code i'm using (with some stuff hidden..)

PHP Code:
$username $vbulletin->userinfo[username];
$email$vbulletin->userinfo[email];
$userid$vbulletin->userinfo[userid];


$xml "<xmlrequest>
    <username>hidden</username>
    <usertoken>hidden</usertoken>
    <requesttype>subscribers</requesttype>
    <requestmethod>AddSubscriberToList</requestmethod>
    <details>
        <emailaddress>
$email</emailaddress>
        <mailinglist>1</mailinglist>
        <format>html</format>
        <confirmed>yes</confirmed>
        <customfields>
            <item>
                <fieldid>1</fieldid>
                <value>
$username</value>
            </item>
            <item>
                <fieldid>2</fieldid>
                <value>
$userid</value>
            </item>
        </customfields>
    </details>
</xmlrequest>
"
;

$ch curl_init('http://www.hidden.com/email/xml.php');
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_POSTFIELDS$xml);
$result = @curl_exec($ch);
if(
$result === false) {
    echo 
"Error performing request";
}
else {
    
$xml_doc simplexml_load_string($result);
    
//echo 'Status is ', $xml_doc->status, '<br/>';
    
if ($xml_doc->status == 'SUCCESS') {
        
//echo 'Data is ', $xml_doc->data, '<br/>';
    
} else {
        
//echo 'Error is ', $xml_doc->errormessage, '<br/>';
    
}

So far it works 60% of the time. All of my tests succeeded in the successful addition of the user into my interspire email marketer list so I know it works, I guess I just want to know if there is something I can do to improve the reliability of the script.
Reply With Quote
  #2  
Old 07-11-2008, 12:26 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If the xml is on the same server as your forums, why not use php file functions then curl.
Reply With Quote
  #3  
Old 07-11-2008, 12:42 AM
citricguy citricguy is offline
 
Join Date: Jun 2005
Location: Maui, Hawaii
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

They are indeed hosted on the same server, in different directories.

Would the use of php file functions in essence replace the curl stuff, or would I need to modify the XML code too?
Reply With Quote
  #4  
Old 07-11-2008, 12:58 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe the file functions will just replace the curl functions but I haven't really done much with the file functions and xml. Just the file functions will save a bit of processing compare to using curl that I know.
Reply With Quote
  #5  
Old 07-11-2008, 01:52 AM
citricguy citricguy is offline
 
Join Date: Jun 2005
Location: Maui, Hawaii
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank's for the info MoT3rror, I'm going to try to update the code and add some logging code so I can see whats going on. Hopefully I can eventually turn this into a mod.
Reply With Quote
  #6  
Old 10-13-2008, 11:40 PM
smooth-c smooth-c is offline
 
Join Date: Jan 2008
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys, i've been working with citric guy and he did get this working with the following code;

(i've HIDDEN personal bits)

Code:
$username = $userinfo['username'];
$email= $userinfo['email'];
$userid= $userinfo['userid'];


$xml = "<xmlrequest>
    <username>HIDDEN</username>
    <usertoken>HIDDEN</usertoken>
    <requesttype>subscribers</requesttype>
    <requestmethod>AddSubscriberToList</requestmethod>
    <details>
        <emailaddress>$email</emailaddress>
        <mailinglist>4</mailinglist>
        <format>html</format>
        <confirmed>yes</confirmed>
        <customfields>
            <item>
                <fieldid>1</fieldid>
                <value>$username</value>
            </item>
            <item>
                <fieldid>2</fieldid>
                <value>$userid</value>
            </item>
        </customfields>
    </details>
</xmlrequest>
";

$ch = curl_init('http://www.HIDDEN.com/inspire/xml.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$result = @curl_exec($ch);
if($result === false) {
    echo "Error performing request";
}
else {
    $xml_doc = simplexml_load_string($result);
    //echo 'Status is ', $xml_doc->status, '<br/>';
    if ($xml_doc->status == 'SUCCESS') {
        //echo 'Data is ', $xml_doc->data, '<br/>';
    } else {
        //echo 'Error is ', $xml_doc->errormessage, '<br/>';
    }
}
Citric has this mod working seamlessly with his forum, we've been working together and i've came across a problem where, when I register a test account - it works instantly, but any further accounts created on my end, aren't added to the inspire/sendstudio database.

Citric has tried this on his end and it's exactly the same.

The only thing different on my end is that I have manual admin approval for all registrations, aswell as email authentication and he only has email authentication.

The hook location currently used, which works for him fine is register_activate_process

Can anyone see why this would happen? Why it would work once from one computer, then not continue?

Thank you very much!

Greg
Reply With Quote
  #7  
Old 10-14-2008, 12:02 AM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What happens when you dont use email authentication?
Reply With Quote
  #8  
Old 10-14-2008, 01:33 PM
smooth-c smooth-c is offline
 
Join Date: Jan 2008
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The same
Reply With Quote
  #9  
Old 11-04-2008, 01:14 PM
leitel leitel is offline
 
Join Date: Mar 2003
Location: Costa Rica
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A major factor in choosing a mailer program is its ability to sync with vB. I am currently evaluating 12all from activecampaign. http://www.activecampaign.com/12all/
It has a way to sync directly with vB db tables.
It is not much less in price than Interspire. Would anyone familiar with these products care to share their insights?
Thank you
Reply With Quote
  #10  
Old 12-01-2008, 08:16 PM
BigSoccer Tech. BigSoccer Tech. is offline
 
Join Date: Feb 2005
Location: Manhattan
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great thread!

I have demod both and interspire is certainly much more elegant. But the reason I haven't pulled the trigger is the integration issue.

--------------- Added [DATE]1228171032[/DATE] at [TIME]1228171032[/TIME] ---------------

solved here i think???

http://www.interspire.com/forum/show...46&postcount=7
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05391 seconds
  • Memory Usage 2,262KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete