How to add multiple attachment in Email Quote ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manosingh
    Member
    • Apr 2019
    • 62

    How to add multiple attachment in Email Quote ?

    Hi ,

    I have an Email with attachment pdf option in Sales pack extension , now i added a image field in the Quote , i need to add the image in the attachment of the email , how can i do that ?

    \application\Espo\Modules\Sales\Services\Quote.php

    In this file i checked for a function getAttributesForEmail() which does Email content and attachments of pdf , how can i add my own custom attachment here. Let me know , Thanks in advance
  • manosingh
    Member
    • Apr 2019
    • 62

    #2
    Hi ,

    I have added my custom attachment by adding this code

    $attachment_custom = $this->getEntityManager()->getEntity('Attachment');

    $attachment_custom->set([
    //'name' => \Espo\Core\Utils\Util::sanitizeFileName($template->get('name') . ' ' . $quote->get('name')) . '.pdf',
    'name' => 'roofproposalimg1.jpg',
    'type' => 'application/image',
    'role' => 'Attachment',
    'contents ' => '<img src="?entryPoint=image&amp;id=" title="img.jpg">'
    ]);

    $this->getEntityManager()->saveEntity($attachment1);

    $attributes['attachmentsIds'] = array($attachment->id , $attachment1->id);
    $attributes['attachmentsNames'] = array(
    $attachment->id => $attachment->get('name'),
    $attachment1->id => $attachment1->get('name')
    );



    When i try to attach an image , this image preview is not showing there what i need to give in the content section to show the image preview , let me know , thanks in advance

    Comment

    Working...