maisondunet/module-email-attachment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maisondunet/module-email-attachment

Composer 安装命令:

composer require maisondunet/module-email-attachment

包简介

Add invoice / shipment / creditmemo and custom attachments files to magento sales emails

README 文档

README

This module Open-source module allow the administrator to attach Invoice, Shipment, Credit Memo and Custom PDF Files to sales email notification. It has been design to be as simple, expendable and as unobtrusive as possible.

It doesn't contain any bloatware just the bare minimum.

Compatibility

The module has been tested with Magento 2.4.5, it should work with any 2.4.* magento installation.

Installation

To install the Magento 2 GTM Cookie consent, simply run the command below:

composer require maisondunet/module-email-attachment

To enable the module:

bin/magento module:enable Maisondunet_EmailAttachment

Module configuration

Module configuration is located at :

Stores > Configuration > Sales > Sales Emails

Invoice Options

Field Description
Attach PDF Invoice Attach a PDF invoice to invoice notification e-mails

Shipment Options

Field Description
Attach PDF Invoice Attach a PDF Shipment to shipment notification e-mails

Credit Memo Options

Field Description
Attach PDF Credit Memo Attach a PDF Credit Memo to credit_memo notification e-mails

Email Attachments Options

This functionality allow the administrator to attach custom Files to sales-emails.

Name Templates File
Attachment Name The file will be attached to selected template email The file attached

Extensibility

Create a class to handle you custom attachment

class CreditMemo implements AttachmentResolverInterface
{
    // --------
    
    /**
    * @param Template $template
    * @return MimePartInterface[]
     */
    public function getAttachments(Template $template): array{
        // Build your custom attachment there
    }
}

And register to service inside a di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Maisondunet\EmailAttachment\Model\AttachmentResolverPool">
        <arguments>
            <argument name="attachmentResolvers" xsi:type="array">
                <item name="credit_memo" xsi:type="object">Maisondunet\EmailAttachment\Model\AttachmentResolver\SystemConfiguration</item>
            </argument>
        </arguments>
    </type>
</config>

统计信息

  • 总下载量: 3.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2023-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固