Author Topic: Import Follow-up Messages  (Read 2987 times)

spot

  • Posts: 8
    • View Profile
Import Follow-up Messages
« on: April 03, 2007, 09:25:51 pm »
Hello Dean,

I really, really would like to have a feature that you can import a .doc file that contains messages.  As an example, instead of inserting each message, one at a time, you could enter them in a batch.  You could have a .doc or .txt file with maybe 52 messages, maybe separated with &&&&& or something like that.

What do you think?  Would it be possible?

This is something that I would even be willing to pay extra for just to get it, because I could really use it.

Maybe a separate program could be written just to accomplish this task.

Thanks,

Shawn
Shawn

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import Follow-up Messages
« Reply #1 on: April 12, 2007, 04:11:19 pm »
Shawn,

I have done similar scripts to this and would be willing to help out for a token payment of $10 or so to paypal @listmailpro.com

What will the subject line be for each message?  This could be static with an incrementing #, ie "Super E-Course #001" or could be set on a per message basis with an additional separator string.

I don't recommend .Doc files for this, but rather plain text.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Possible dollars - import messages script..
« Reply #2 on: April 19, 2007, 08:01:10 pm »
DW,

Did you get this started?

Quote
I have done similar scripts to this and would be willing to help out for a token payment of $10 or so to paypal @listmailpro.com


I need something like this.  I have hundreds of messages - sitting adding/arranging/sorting them in the Followups page is ridiculously time consuming - I'm on my 3rd day trying to get a change in the order of the messages, add to some messages, change some, and rearrange others.

I need a simple import, that will IMPORT into a SET (as the load/save set that appear on the Followups page).  I need an import to go into a set, ask me for the set name, and then IMPORT the text (much the same way as importing users) - the easiest for me would be 1 line per followup (not sure if that's possible, but here's the order for each row:
SUBJECT, SEQ, DELAY, CRON, MESSAGE

How about ask me what the seperator is and then the followups are all in one file - like this (below I use '#' as the seperator):
---------------------------------------------------------------------
followup1# 1# 0# #Hi !fname,

Here's my first message to you as a test.

Hope you like it.

Thanks,
-Brett
#followup2# 2# 3# #Hi !fname,

Did you like my first followup - here's my second.

Thanks,
-Brett#
---------------------------------------------------------------------

How about it?  I need it right away, it's taking me days to do this manually, and I already have the subject lines, text, in files.
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Import Follow-up Messages
« Reply #3 on: April 23, 2007, 07:20:16 am »
bump
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import Follow-up Messages
« Reply #4 on: April 24, 2007, 05:08:25 pm »
Brett,

I was busy yesterday setting up a new database server for another project and have a few paid requests and another server setup to do today.  I'll revisit this in a few hours. :)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Import Follow-up Messages
« Reply #5 on: April 24, 2007, 08:12:45 pm »
Hi DW,

Quote
I'll revisit this in a few hours


Thanks, I'd really appreciate it... I'm guessing it should be fairly simple, as you know the formats for the tables, and you already have a method for saving the followups (in the php files)?

I'd really love it, as I said I use 30-40 followups per list, and even though the 'sets' really help, I still need a way to load up the sets by importing the followups - another possible idea - present a screen to:

Manage Sets
------------
On that screen there are options for importing from text files, into a single Followup, or multiple Followups (entire sets).  I currently save each followup in a standard text file - the header of that file (first few lines) is usually the subject of the email, I could also store the seq/delay information in there - though it's not likely - and would prefer to load the seq/delay info directly from the set information...

Hope that makes sense?  Anyway, I could see where you load up a Followup from the text file, and then just automatically increment the seq number from the current seq + 1, and then ask for a default delay - if I put in 3, that means every followup I import will have a delay of 3, and the seq number will increment one each time I load a new one -

I think what I'm getting at is a way to 'build up a set' from imported text files.  But, if that's too much work - just having an import from one HUGE FILE would also work - it still would save me time from having to edit, return to main, over and over, etc...

Let me know what you think - I'll paypal you some $ for getting that going... Thanks...
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import Follow-up Messages
« Reply #6 on: April 25, 2007, 06:58:29 am »
Brett,

I've been working on a custom script to import your particular file - I would prefer not to design a whole interface around it at this time.

I'm finding it a little difficult because the separator characters are not each on a new line - in fact, this has led me to load the entire file-to-import into an array.  I hope this does not create an array so big it doesn't fit within your server's memory limit...

Please stand by while I complete it
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Import Follow-up Messages
« Reply #7 on: April 25, 2007, 07:08:13 am »
DW,

Quote
in fact, this has led me to load the entire file-to-import into an array


Not sure about that, most of these followups also have an additional message (followup), so for about 40 followups I need to import 80 messages!  Quick calculation, each message is 10-12K so 80*10K = 800K, will all of that fit in memory?  

Other options?  

If 800K is too big, it would be fine if I can select to 'upload one file', then 'Append to the set' by 'Upload Another file', etc, or if the script could read the files in one after another, for example, base file name = 'followups-basic-sequence1.txt', the next file is: 'followups-basic-sequence2.txt', etc, etc, until there are no more files, then it knows they have all been imported, would that make it easier for you?  In fact that might work really good because I could change the order of the followups just by re-numbering the files.

Let me know what you think and come up with...
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import Follow-up Messages
« Reply #8 on: April 25, 2007, 07:11:28 am »
Here you go - upload this script and your file (referenced in this script as testfile.txt) to your ListMail folder and browse to the script to run it in test mode.
Code: [Select]
<?php/* import followups from file format (subj/seq/delay/cron/message):followup1# 1# 0# #Hi !fname,Here's my first message to you as a test.Hope you like it.Thanks,-Brett#followup2# 2# 3# #Hi !fname,Did you like my first followup - here's my second.Thanks,-Brett# */// config$filename='./testfile.txt';if(!$live) $testmode=true;  // set to false to run it live all the time!// begin scriptif($testmode) echo "TEST MODE - Nothing written to database!  Browse to ?live=1 or enable in script<hr>"; else echo "LIVE MODE - Writing to database<hr>";include('./config.php');include('./admin.php');// create and name new followup set$cmd = "insert into $fstable values('','Imported Set ".date("Y-m-d H:i:s T")."');";echo "CMD=$cmd<br>";if(!$testmode){ mysql_query($cmd) or die(mysql_error()); $sid = mysql_insert_id();} else $sid = '99';$file='';$fp = fopen($filename,'r') or die('could not open file '.$filename);while(!feof($fp)){ $file .= fgets($fp,1024);}$data = explode('#',$file);echo "element count = ".count($data)."<br>";// pop off remainders, so elements are divisible by 5$remainder = count($data)%5;if($remainder>0){ for($i=0;$i<$remainder;$i++) array_pop($data); echo "element count2 = ".count($data)."<br>";}echo "message count = ".(count($data)/5)."<hr>";for($i=1;$i<=count($data)/5;$i++){ $j=$i*5-5; $subj = trim($data[$j]); $seq = trim($data[$j+1]); if(!is_numeric($seq)) $seq='1'; $del = trim($data[$j+2]); if(!is_numeric($del)) $del='0'; $cron = trim($data[$j+3]); $msg = trim($data[$j+4]); echo "subj=$subj seq=$seq del=$del cron=$cron msg=".nl2br($msg)."<hr>"; // insert message $cmd = "insert into $ftable values('','0','0','".addslashes($subj)."','".addslashes($msg)."','','','$seq','$del','$cron','$sid');"; echo "^CMD=$cmd<hr>"; if(!$testmode) mysql_query($cmd) or die(mysql_error());}?>

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting