techmistress Posted September 9, 2013 Share Posted September 9, 2013 I am trying to use the Newsletter feature. When I add images, they only include the relative url path (/images/myimage.jpg). Where in the editor, template, cubecart, etc. can I set the path to be the full url. Without the full url, the images break in the email. I've searched for hours and can't find where to put the full url. Thanks! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2013 Share Posted September 9, 2013 I don't use the Newsletter function, since we use a commercial MailChimp mod instead. But you should be able to get the full url by using the Source, rather than WYSIWYG, editor choice in the top left corner of the editor box. Quote Link to comment Share on other sites More sharing options...
techmistress Posted September 9, 2013 Author Share Posted September 9, 2013 Yes, if I insert an image, and the use the source or just click the edit image button, I can add on the full url. I was just wondering where I can program it in hard code. It's a real pain to do it if my client has a newsletter with a buch of images. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2013 Share Posted September 9, 2013 The newsletter and email skeleton code is in the database. In "Source code" mode of the editor, you can use {$STORE_URL} to hold the fixed part of the web address. Quote Link to comment Share on other sites More sharing options...
techmistress Posted September 9, 2013 Author Share Posted September 9, 2013 What file would I do this in? I don't want to do it every time I create a newsletter or an email. I tried editing various files from the CKEditor, but no luck. There is no place to do this in the email templates. Forgive me if I'm not understanding the instructions. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2013 Share Posted September 9, 2013 There are two parts to a newsletter/email: the skeleton that shows the heading, salutation, closing and footer; and then there is the main body content area. In admin, click Email Templates in the left-side navigation. There is the Email Contents tab, the Email Templates tab, and an Import tab. The Email Templates tab is where the skeletons are edited. Starting with the supplied skeletons in CubeCart, you can clone one and edit the new one to suit your needs. Click the edit icon for the Default Newsletter. There is a new series of tabs: General - this is the name of the newsletter, "March Madness", Winter Holidays", whatever. The recipient does not see the name. It is for your own use. HTML Content and Plain Text Content - self-explanatory. (In CubeCart, do not click the browser's Back button. There is a mechanism in place that will frustrate you to no end if you regularly do this to return to previous pages. Instead, click the place you want to go using the "breadcrumbs" just below the tabs.) Click Newsletters in the left-side navigation. Then click the Create Newsletter tab. In addition to the tabs as mentioned above, there is a Test Send feature. The Content tabs are used to create (or edit existing content templates) the body of the newsletter CubeCart will replace {$EMAIL_CONTENT} in the skeleton template with what is created here. Would you like to create a newsletter to walk you through the steps involved? Quote Link to comment Share on other sites More sharing options...
techmistress Posted September 9, 2013 Author Share Posted September 9, 2013 Ok, now I see. You are not understanding my question. I know where to make a template (skeleton code) and I know where to create a newsletter (Newsletters). The issue I'm speaking of is the insert images function of the editor itself. When using that button to insert an image into the newsletter or an email, it gets mailed off using the relative path (/images/mypic.jpg) and therefore is not visible when a user opens the email. I need to figure out where I can change that function to include the full server path, so the images show in the email. I realize I can do this manually on each image after it's inserted, but I'm trying to make it easy for my client. I hope that makes sense. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2013 Share Posted September 10, 2013 When the image Properties window pops up, you have the opportunity to Browse the Server. Assuming there are images available, and one is chosen, the resulting link will be a "relative" link. For example: images/source/FL1000-b.jpg Before dismissing the Image Properties box, add {$STORE_URL}/ in front of the link in the URL field: {$STORE_URL}/images/source/FL1000-b.jpg (Also, a bug in CubeCart will remove the backslashes used by Windows servers used as the folder separator. Be sure to replace the backslashes with forward slashes. Another bug will add CubeCart's branding to the skeleton template every time it is edited and saved.) I agree that the routines to Create/Edit email-based templates and newsletters should have full URLs. Quote Link to comment Share on other sites More sharing options...
techmistress Posted September 10, 2013 Author Share Posted September 10, 2013 Alright I will try to find it in the image dialogue box, then. The editor files are a bit different because they are configured for CC. The file to edit is: /includes/ckeditor/plugins/image/dialogs/image.js Once I figure the exact line to edit, I'll post. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 10, 2013 Share Posted September 10, 2013 My approach is to be in the CubeCart code that accepts the POSTed content, then preg_match for all instances of an image tag, and add the {$STORE_URL}/ part before it gets into the database. /admin/sources/documents.email.inc.php, near lines 235-287. There is also the possibility of using a <base href> in the templates. I just need to find where the template is stored that creates new templates. Ok, there is no template to create new templates. (Well, there is, but it's not what we want.) When a new skeleton template is being created, all that CKEditor gives us is a bare <html><head><title><body> structure. So, we can edit the existing templates (the two created when CubeCart was installed and these two templates were loaded into the database) by adding: <base href="{$STORE_URL}" /> This allows for the viewing of the image that just got inserted as the relative URL path is valid for the editor. Then clone all others from those. Yup. That works for me. Quote Link to comment Share on other sites More sharing options...
techmistress Posted September 10, 2013 Author Share Posted September 10, 2013 Well there you go. Opened the "Default Newsletter" template (from within admin) and added <base href="{$STORE_URL}" /> to the head of the html source code. Sometimes things are that simple. Thanks for the time and effort. SOLVED! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.