Results 1 to 11 of 11

Thread: Import E-mail Templates from 5.4 to 1.3

  1. #1
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default Import E-mail Templates from 5.4 to 1.3

    I just upgraded one of my sites from 5.4 to 1.3. In 5.4 all the e-mail templates where in a folder /themes/your_theme/mail. Now in 1.3 they are in the DB and there is a import feature. I've tried using the import feature but it keeps telling me the format is unsupported. Does anyone have a guide or know of an easy way I can import my 5.4 e-mail templates??
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    It sure looks like a guide would be good, because the templates are a mix of xml and html.

    Here's the structure

    <begin_template>
    <email_id>email_id:x</email_id>
    <nameemail>nameemail:x</nameemail>
    <subject>subject:x</subject>
    <bodytemplate>bodytemplate:body of email here</bodytemplate>
    <end_template>

    Quote simple really. There are 34 emails in the database. So email_id: is between 1 and 34.

    nameemail: is the name of that email template
    subject: is the subject of that email

    The bodytemplate container begins with bodytemplate: and then is text and HTML

    And of course we have a container to put it all in that has a begin and end.

    I've attached a spreadsheet with the DEFAULT emails in them. It may be easier for you to understand in Excel format. And below is what the actual entry looks like for email number one which is add_ok


    <begin_template>
    <email_id>email_id:
    1</email_id>
    <nameemail>nameemail:
    add_ok</nameemail>
    <subject>subject:
    Resource Added</subject>
    <bodytemplate>bodytemplate:
    <div style="font-weight:bold;">Thank you for your submission to <%$site_name%></div>
    <p>
    <div style="float:left;width:200px;">Resource ID</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$link_id%></div>
    <div style="float:left;width:200px;">Title</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$title%></div>
    <div style="float:left;width:200px;">Url</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$url%></div>
    <div style="float:left;width:200px;">Description </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$description%></div>
    <div style="float:left;width:200px;">Category </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$category%></div>
    <div style="float:left;width:200px;">Contact name</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$contact_name%></div>
    <div style="float:left;width:200px;">Email</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$email%></div>
    <div style="float:left;width:200px;">Password </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$password%></div>
    <p>
    Your link has been added.
    <p>
    <p>
    Regards,
    <p>
    <%$site_name%> Team
    </bodytemplate>
    <end_template>
    Attached Files Attached Files

  3. #3
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Thanks for this Bruce!! Will I need to import 34 different files or can it all be done in 1 file. Also, what format can it be imported in, a CSV, TXT, etc.???
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Believe it or don't, when I exported the files my browser saved it as an html file.

    My guess is that it's not formed correctly and should have been .xml

    Yes they can be done in one large file.

  5. #5
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Ok... But I'm still confused on the type of file I should save it as?!?!?! Should I save it as an .xml / .html / .txt ?????
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  6. #6
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    I don't know, I only know what it exported the file as. I would assume it would be xml. Give it a try.

  7. #7
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Bruce...

    When I exported the E-mail Template I received it as a .txt file. I then went and edited the file making my changes within the same format. I then tried to import the same file with my changes, and I cant get it to work. None of my changes are saved, yet the admin panel says all of them have been modified when importing.

    Can you please test it on one of your 1.3 sites? I tried to test it on the demo but its still 1.1.

    I'll post it in the Project Tools if we can get one more person to see if they have the same problem.
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  8. #8
    Join Date
    Aug 2008
    Posts
    49

    Default

    @FSGDAG
    you can save it as a txt or xml file.

    for import_template_mail, there is still have some problem, but i have fixed it and commited on svn http://nicecoder.com/svn/index.php?act=changeset&id=998. before i commited it, i have tried it to imported, it worked out.

  9. #9
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I figured out what the problem was....

    Quote Originally Posted by Bruceper View Post
    <begin_template>
    <email_id>email_id:x</email_id>
    <nameemail>nameemail:x</nameemail>
    <subject>subject:x</subject>
    <bodytemplate>bodytemplate:body of email here</bodytemplate>
    <end_template>
    Remove the text in red... So it should look like this

    Quote Originally Posted by Bruceper View Post
    <begin_template>
    <email_id>1</email_id>
    <nameemail>add_ok</nameemail>
    <subject>Resource Added</subject>
    <bodytemplate><div style="font-weight:bold;">Thank you for your submission to <%$site_name%></div>
    <p>
    <div style="float:left;width:200px;">Resource ID</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$link_id%></div>
    <div style="float:left;width:200px;">Title</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$title%></div>
    <div style="float:left;width:200px;">Url</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$url%></div>
    <div style="float:left;width:200px;">Description </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$description%></div>
    <div style="float:left;width:200px;">Category </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$category%></div>
    <div style="float:left;width:200px;">Contact name</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$contact_name%></div>
    <div style="float:left;width:200px;">Email</div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$email%></div>
    <div style="float:left;width:200px;">Password </div>
    <div style="float:left;width:10px;"> : </div>
    <div style="float:left;width:200px;"><%$password%></div>
    <p>
    Your link has been added.
    <p>
    <p>
    Regards,
    <p>
    <%$site_name%> Team
    </bodytemplate>
    <end_template>
    I now had a TON of extra templates added to the DB... When keeping those items in red in the imported template, it adds them as new ones. I guess I have to go into the DB via phpMyAdmin and remove them manually if I dont want them there?

    EDIT: Also ensure that there aren't any line breaks in between the statements.

    Example :

    Incorrect way

    Code:
    <email_id>1
    </email_id>
    <nameemail>add_ok
    </nameemail>
    <subject>Resource Added
    </subject>
    CORRECT WAY:

    Code:
    <email_id>1</email_id>
    <nameemail>add_ok</nameemail>
    <subject>Resource Added</subject>
    Doing it the incorrect way will lead to duplicate / additional e-mail templates that wont work
    Last edited by FSGDAG; 02-08-2009 at 10:29 PM.
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  10. #10
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Interesting. Yes you would need to do it through phpmyadmin.

  11. #11
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Also ensure that there aren't any line breaks in between the statements.

    Example :

    Incorrect way

    Code:
    <email_id>1
    </email_id>
    <nameemail>add_ok
    </nameemail>
    <subject>Resource Added
    </subject>
    CORRECT WAY:

    Code:
    <email_id>1</email_id>
    <nameemail>add_ok</nameemail>
    <subject>Resource Added</subject>
    Doing it the incorrect way will lead to duplicate / additional e-mail templates that wont work
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

Similar Threads

  1. import from esyndicat
    By thomaswhiteeagl in forum Pre-Sales Questions
    Replies: 3
    Last Post: 03-18-2008, 07:37 PM
  2. Replies: 7
    Last Post: 12-16-2007, 08:35 PM
  3. Updated mail templates
    By Bruceper in forum Blocks and Modification
    Replies: 0
    Last Post: 09-22-2007, 04:24 PM
  4. notification e-mail different than contact e-mail
    By vsevedko in forum Blocks and Modification
    Replies: 2
    Last Post: 09-23-2006, 09:53 AM
  5. editing mail templates
    By lb6364 in forum v5.x
    Replies: 2
    Last Post: 02-16-2005, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •