I am using simplenews with mimemail. I have implemented mail.css which has been placed in the main directory of the zen sub-template. I have copied the template from simplenews and modified it and it appears that it is being read, as the content comes out in the mail that arrives. The problem is that the image arrives but not as a CID number as one would expect (embedded) but as a web address (which is how it is included in the template).
<img style="float:left" src="http://www.sitename.co.za/sites/default/files/lsc3.jpg" width="150" alt="" border="0">
Possibly I have missed something in the documentation, regarding this line but it would appear that mimemail is not embedding it.
I'd be grateful for assistance!
Comments
Comment #1
sgabe CreditAttribution: sgabe commentedDid you read the README.txt?
Comment #2
sgabe CreditAttribution: sgabe commentedComment #3
hbblogger CreditAttribution: hbblogger commentedHi,
Thanks for your response. In fact I did read the readme.txt .
I have tried each of the options suggested (although for the second one I used
/home2/mydomain/public_html/mysite.co.za/sites/all/default/files/mypicture.jpg
)I have placed this code in mimemail-message.tpl.php and placed this in the root folder of my zen subtheme (having first changed my admin to the zen subtheme) and confirmed using a message that this is in fact the file being displayed.
I have also placed a similar piece of code in the simplenews-newsletter-body.tpl.php file which was placed in the template folder of my zen subtheme. This also displays but still no image.
I send my e-mails to both outlook 2003 and to g-mail.
Comment #4
hbblogger CreditAttribution: hbblogger commentedFor completeness, I have just tried
/home/www/.......
Comment #5
sgabe CreditAttribution: sgabe commentedThis is a huge misunderstanding. You can embed images only in the body of the message, not in the template files. Let's clear this up in the README.txt file.
Comment #6
hbblogger CreditAttribution: hbblogger commentedThats a real pity as the template is really where you need to be able to add images (such as logos) to keep the look and feel the same. Thanks for letting me know, though. If that ever changes - I'd be keen to hear about it.
Comment #7
sgabe CreditAttribution: sgabe commentedWell, this issue can be either a feature request or a task to update the documentation with this information.
Comment #8
hbblogger CreditAttribution: hbblogger commentedI hereby request that a feature be added to the Mime Mail module to enable the use of templates that include embedded images.
Comment #9
hbblogger CreditAttribution: hbblogger commentedI hereby suggest that until a feature is available in the Mime Mail module to embed images in the template, that the exisiting readme.txt file be updated to indicate that images embedded in the template will not be converted by Mime Mail and thus will not be displayed in the recipients e-mail message.
Comment #10
sgabe CreditAttribution: sgabe commentedI have just tested this and it is working with both branches. If the path is a correct relative path the image will be embedded in the message.
Comment #11
bshensky CreditAttribution: bshensky commentedConfirmed #10 - embedding of an image inside the template file does indeed work. Do not put the leading slash ahead of the asset hanging off the base_path.
Glad that this works!
Comment #12
finneWhen you use a private filesystem in D6 you cannot embed images from your theme folder (such as the logo). To achieve this copy the logo to somewhere inside your private file path, so the mime mail access check allow embedding. I used
<img src="<?php print base_path(); ?>sites/default/files/theme/logo.png" alt="logo" />
Setting the privilege 'send arbitrary files' did not work either because the simplenews module I use sends messages as the anonymous user (thus the access check fails or I should allow this privilege for the anon user)
Comment #12.0
finneModified my code so that it reflected code not image.
Comment #13
bnorbi CreditAttribution: bnorbi commented#12 worked for me in D6.
Comment #14
mibfire CreditAttribution: mibfire commentedDoes this work only with images in files folder like "sites/default/files/mypicture.jpg"? Cos i havent been able to embed image using my theme directory like "sites/all/themes/mytheme/images/logo2.png".
Comment #15
gusantor CreditAttribution: gusantor commentedIn mytheme/mimemail-message.tpl.php I have
when I'm logged as Administrator I receive a nice email with three images, but logged as some other registered user, email with no images at all
some idea how to get all user have images on email ?
Comment #16
mdruilhe CreditAttribution: mdruilhe commentedI have the same problem using simplenews with D7 and mimemail 7.x-1.0-beta3
In my template, if I put :
<img src="<?php echo base_path()?>sites/all/themes/mytheme/img/newsletter/logo.png" alt="Logo" />
or
<img src="sites/all/themes/mytheme/img/newsletter/logo.png" alt="Logo" />
The images aren't displayed in the mail, even logged in as admin.
It works fine with mimemail 7.x-1.0-alpha2 :both images are showing in the mail.
I guess the problem is in _mimemail_file() (mimemail.inc) but I don't know how to solve it.
Please, any thought ?
Thanks in advance for your help
Comment #17
rbosscher CreditAttribution: rbosscher commentedI've had the same problem, after investigating the issue, I came to line 190 in mimemail.inc
This piece of code only allows files from your public files folder.
So no theme images are possible in your mimemail-message.tpl.php.
Strange enough, this is only the case when I try sending with simplenews.
Other modules will send out the theme files just fine.
Comment #18
dualcorpse CreditAttribution: dualcorpse commentedIt actually worked for me using $GLOBALS['base_url'] (as anonymous user) :