A bit of advice on embedding
Moderators: Chris Corbyn, General Moderators
A bit of advice on embedding
Having built a "timer" to send all 2500 emails at intervals with attachments, I have now been given the dubious honor of embedding PDF files into each email.
Is this possible through Swiftmailer or would I have to transfer the stuff to HTML or word to embed the document into the email?
Thanks
Is this possible through Swiftmailer or would I have to transfer the stuff to HTML or word to embed the document into the email?
Thanks
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: A bit of advice on embedding
It's possible, but I'm wondering if a simple attachment will suffice? Embedding a PDF may not work on all mail clients.roscoe wrote:Having built a "timer" to send all 2500 emails at intervals with attachments, I have now been given the dubious honor of embedding PDF files into each email.
Is this possible through Swiftmailer or would I have to transfer the stuff to HTML or word to embed the document into the email?
Thanks
I'll have to refresh my memory on the format you need for embedded files without HTML...
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
They can insist but they can't haveroscoe wrote:I have been told that it may be in other formats like word. Is Word more practical?
They insist the want to embed the info and not have to open it, but they will want it in either PDF or Word
If I were you I'd be talking your client out of this idea because it's going to cause you a lot of headaches when he/she realises it doesn't work as expected
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
The CID is the ID of the particular area of content you want to reference (Content-ID). Like with HTML you'll be used to doing:roscoe wrote:silly question but what is the CID and what does it do?
They are settling for HTML with images (would they be attachments in the case of embedded pics?)
Code: Select all
<img src="http://some.server/images/image.png" />Code: Select all
<img src="cid:the-content-id-of-some-image" />- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
The image needs to be a local image on the server's filesystem. See this:
http://www.swiftmailer.org/wikidocs/v3/ ... ing_images
http://www.swiftmailer.org/wikidocs/v3/ ... ing_images
So to confirm, I create the HTML and where the images (I need more than one) should live I put in
(the path of the file I know from where it uploads attachments directly to the server)
cos this bit should be inside the HTML?
Or could I upload the HTML with the paths already set ?
Can you write <php? ?> with HTML extension???
Sorry I am being so dense, perhaps it is the thunder.
Code: Select all
<php? <img src=\" . $message->attach(new Swift_Message_Image(new Swift_File("/path/to/image.jpg"))) . "\ >, \"text/html\")); ?>cos this bit should be inside the HTML?
Or could I upload the HTML with the paths already set ?
Code: Select all
<img src="mypath/myplace/myserver/mypic.jpg">Can you write <php? ?> with HTML extension???
Sorry I am being so dense, perhaps it is the thunder.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
roscoe wrote:So to confirm, I create the HTML and where the images (I need more than one) should live I put in
(the path of the file I know from where it uploads attachments directly to the server)Code: Select all
<php? <img src=" . $message->attach(new Swift_Message_Image(new Swift_File("/path/to/image.jpg"))) . "\ >, "text/html")); ?>
cos this bit should be inside the HTML?
Or could I upload the HTML with the paths already set ?
Code: Select all
<img src="mypath/myplace/myserver/mypic.jpg">
Can you write <php? ?> with HTML extension???
Sorry I am being so dense, perhaps it is the thunder.
Code: Select all
$cid = $message->attach(new Swift_Message_Image(new Swift_File("/some/image.png")));
$body = "Here's an image <img src="" . $cid . "" /> and the same again <img src="" . $cid . "" />";
$message->attach(new Swift_Message_Part($body, "text/html"));I am assuming that as $cid would only cover one image, I would need to add variables :
etc.
Thanks
Code: Select all
$cid = $message->attach(new Swift_Message_Image(new Swift_File("/some/image.png")));
$cid2 = $message->attach(new Swift_Message_Image(new Swift_File("/some/image2.png")));Thanks