Author Topic: Import follow up emails  (Read 13147 times)

lambertb

  • Posts: 29
    • View Profile
Import follow up emails
« on: February 20, 2006, 07:15:17 am »
Hi

I'm migratiing from another system.  I have about 75 custom messages that run on 3 different lists

I figured out that I could add 1 message to 1 list, then in the drop down, click on 'save' to the other 2 lists.

But, its taking me forever.

Is there a way to import them?  They're just text right now.

Any tips/tricks to getting it done quicker?

Brian

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import follow up emails
« Reply #1 on: February 20, 2006, 03:04:14 pm »
Depending on the format it may be possible to write a custom script to enter your followups in semi-automated fashion.

Can you export all messages from your old program into text files with unique 'separater' characters between them?

If all lists use the same set of messages it would take a simpler custom script to copy those followups to other lists.

I don't mind taking on such a simple job free of charge to get you up and running.

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

lambertb

  • Posts: 29
    • View Profile
Great!!
« Reply #2 on: February 20, 2006, 03:49:47 pm »
Yes!  they are all in text files separately.

They all have been numbered as well.

So, I need to put all of them into 1 text file (big long one), with a separater between them?  (like an ******* )

Or, move them into Excel fields and export out as a CSV with a header for 1, 2, 3, 4, 5, 6, 7 etc?  Excel fields are limited in length, so I doubt that's what you mean, but I wanted to be sure.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import follow up emails
« Reply #3 on: February 20, 2006, 04:20:29 pm »
Basically, we just need a way to obtain the data via script - separate text files are fine if the filenames are predictable, ie. 1.txt, 2.txt, etc.

Please send me all details including your instructions, data, FTP and ListMail access to dean@listmailpro.com

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

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Import follow up emails
« Reply #4 on: February 22, 2006, 10:08:29 am »
I've completed the script, compatible with v1.85 - here it is for others to reference:

Code: [Select]
<?php$path_to_listmail = '../';$path_to_files = './';include($path_to_listmail.'config.php');include($path_to_listmail.'admin.php');// set up$filename_start = 'My_Email_';$filename_count = '16';$filename_end = '.txt';$list = '11';$set_seq = '1';$set_delay = '15';// set to true to remove all followups on list before adding new ones// make SURE you have set the $list variable correctly above$delete_all_first = false;if($delete_all_first){	echo "<b>Deleting all existing followups on list $list!</b><br>";	mysql_query("delete from $ftable where list = '$list';") or die(mysql_error());}// scriptecho "Processing files...<br>";for($i=1;$i<=$filename_count;$i++){	$subj_next = '';	$body_next = '';	$body = '';	$fn = $path_to_files.$filename_start.$i.$filename_end;	$fp = fopen($fn,'r') or die("could not open file $fn");	echo "Opened file: <b>$fn</b><br>";	$x=0;	while(!feof($fp)){		$x++;		$line = fgets($fp,2048);		if($subj_next){			$subject = str_replace("/r",'',str_replace("/n",'',$line));			$subj_next = '';		}		if(strpos(' '.$line,'SUBJECT:')>0) $subj_next = 1;		if($body_next){			$body .= $line;		}		if(strpos(' '.$line,'BODY:')>0) $body_next = 1;	}	echo "Subject: $subject<br>";	echo "Body: ".nl2br($body)."<br>";	fclose($fp);	// insert followup	mysql_query("insert into $ftable values('','1','$list','".addslashes($subject)."','".addslashes($body)."','','','$set_seq','$set_delay','');") or die(mysql_error());	echo "<b>Imported followup to list $list!</b><br>";	echo "<hr>";}echo "<b>Messages imported!  do not refresh this page unless you want to run the script again!</b><br>";?>



Instructions:

1. Copy and paste the code above into a new file on your local computer, such as "import1.php".
2. Open the file and check that all of the settings at the top of the script are as desired.
3. Upload the file to a SUB-folder of your ListMailPRO directory, such as "/mail/myimport" along with the My_Email_*.txt files, which should be named My_Email_1.txt through My_Email_16.txt (according to the $filename_count variable at the top of the script)
4. Browse to the file!

Notes: If you want to fix typos or change your files, change the following line in the script so that the original followups are removed when you re-run the script:

$delete_all_first = false;

-to-

$delete_all_first = true;

Your files are expected to be in the following format:

Code: [Select]
SUBJECT:
Your subject line

BODY:
Your message body
Your message body
Your message body


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

lambertb

  • Posts: 29
    • View Profile
THANKS DEAN!!!
« Reply #5 on: February 22, 2006, 10:29:26 am »
wow!

That saved a ton of work!

 :lol:

ioanevans

  • Posts: 2
    • View Profile
Re: Import follow up emails
« Reply #6 on: December 07, 2015, 04:23:29 am »
I tried this solution, getting an error message. I can see its going back to 2006! Is there a way we can utilise this sort of import?

Thanks

Ioan

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Re: Import follow up emails
« Reply #7 on: January 04, 2016, 05:29:50 pm »
Ioan,

What exactly is the error message?  If you need immediate assistance I can also provide paid support, follow the link in my signature below.

Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

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