ilscipio/scipio-erp

View on GitHub
framework/common/servicedef/services_email.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
    <description>Content Component Services</description>
    <vendor>OFBiz</vendor>

    <!-- Email Related Services -->
    <service name="sendMailInterface" engine="interface" location="" invoke="">
        <description>Interface service for mail services.  contentType defaults to "text/html", sendType defaults to
            "mail.smtp.host".  sendVia must be specified if sendType is different.  Configured in general.properties</description>
        <attribute name="sendTo" type="String" mode="IN" optional="true"/>
        <attribute name="sendCc" type="String" mode="IN" optional="true"/>
        <attribute name="sendBcc" type="String" mode="IN" optional="true"/>
        <attribute name="sendFrom" type="String" mode="IN" optional="true"/>
        <attribute name="authUser" type="String" mode="IN" optional="true"/>
        <attribute name="authPass" type="String" mode="IN" optional="true"/>
        <attribute name="port" type="String" mode="IN" optional="true"/>
        <attribute name="sendVia" type="String" mode="IN" optional="true"/>
        <attribute name="sendType" type="String" mode="IN" optional="true"/>        
        <attribute name="socketFactoryClass" type="String" mode="IN" optional="true"/>
        <attribute name="socketFactoryPort" type="String" mode="IN" optional="true"/>
        <attribute name="socketFactoryFallback" type="String" mode="IN" optional="true"/>        
        <attribute name="sendFailureNotification" mode="IN" type="Boolean" optional="true"/>
        <attribute name="sendPartial" mode="IN" type="Boolean" optional="true"/>
        <attribute name="startTLSEnabled" mode="IN" type="Boolean" optional="true"/>
        <!-- SCIPIO: 03-31-2020: Added support for the standard header ReplyTo:
            and custom headers which will be processed only when allowCustomHeaders is true -->
        <attribute name="replyTo" type="java.util.List" mode="IN" optional="true"/>
        <attribute name="allowCustomHeaders" type="Boolean" mode="IN" optional="true" default-value="false" />
        <attribute name="customHeaders" type="java.util.Map" mode="IN" optional="true" />
        <!-- SCIPIO: 11-19-2020: Added "send as" which serves as an alias for "From" field.
            Also a storeName field has been added  to use it in any part of the email (very useful for sendAs) -->
        <attribute name="sendAs" type="String" mode="IN" optional="true"/>
        <attribute name="storeName" type="String" mode="IN" optional="true"/>

        <attribute name="subject" type="String" mode="INOUT" optional="true" allow-html="any"/>
        <attribute name="contentType" type="String" mode="INOUT" optional="true"/>
        <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
        <attribute name="messageId" type="String" mode="INOUT" optional="true"/>
        <attribute name="emailType" type="String" mode="INOUT" optional="true"/>
        <attribute name="orderId" type="String" mode="INOUT" optional="true"/>
        <attribute name="custRequestId" type="String" mode="INOUT" optional="true"/>
        <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/><!-- mail can be disabled in general.properties so no output -->
        <!--  used for parsing and ECAs -->
        <attribute name="communicationEventId" type="String" mode="INOUT" optional="true"/>        
    </service>
    <service name="sendMailOnePartInterface"  engine="interface" location="" invoke="">
        <description>Interface service for sendMail* services.</description>
        <implements service="sendMailInterface"/>
        <attribute name="body" type="String" mode="INOUT" optional="false" allow-html="any"/>        
        <override name="contentType" mode="INOUT"/>
        <override name="subject" mode="INOUT" optional="false"/>
        <override name="emailType" type="String" mode="INOUT" optional="true"/>
        <override name="sendTo" optional="false"/><!-- service will give an NPE when not provided -->
    </service>
    <service name="sendMailMultiPartInterface"  engine="interface" location="" invoke="">
        <description>Interface service for sendMailMultiPart* services</description>
        <implements service="sendMailInterface"/>
        <attribute name="bodyParts" type="java.util.List" mode="INOUT" optional="false"/>
        <attribute name="subject" type="String" mode="INOUT" optional="false"/>
        <override name="contentType" mode="INOUT"/>
    </service>
    <service name="sendMail" engine="java"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
        <description>Send E-Mail Service.  partyId and communicationEventId aren't used by sendMail
            but are passed down to storeEmailAsCommunication during the SECA chain.  See sendMailInterface for more comments.</description>
        <implements service="sendMailOnePartInterface"/>
    </service>
    <service name="sendMailHiddenInLog" engine="java" hideResultInLog="true"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
        <description>Send E-Mail Service.  partyId and communicationEventId aren't used by sendMail
            but are passed down to storeEmailAsCommunication during the SECA chain.  See sendMailInterface for more comments.</description>
        <implements service="sendMailOnePartInterface"/>
        <attribute name="hideInLog" type="Boolean" mode="IN" optional="true"/>                
    </service>
    <service name="sendMailMultiPart" engine="java"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
        <description>Send Multi-Part E-Mail Service</description>
        <implements service="sendMailMultiPartInterface"/>
    </service>
    <service name="sendMailMultiPartHiddenInLog" engine="java" hideResultInLog="true"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
        <description>Send Multi-Part E-Mail Service</description>
        <implements service="sendMailMultiPartInterface"/>
    </service>
    <service name="sendMailFromUrl" engine="java"
            location="org.ofbiz.common.email.EmailServices" invoke="sendMailFromUrl">
        <description>Send E-Mail From URL Service</description>
        <implements service="sendMailInterface"/>
        <attribute name="bodyUrl" type="String" mode="IN" optional="false"/>
        <attribute name="bodyUrlParameters" type="Map" mode="IN" optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="false" allow-html="any"/>
    </service>
    <service name="sendMailFromScreenInterface"  engine="interface" location="" invoke="">
        <description>Interface service for E-Mail sent From Screen Widget</description>
        <implements service="sendMailInterface"/>
        <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="any"/>
        <attribute name="bodyScreenUri" type="String" mode="IN" optional="true"/>
        <attribute name="xslfoAttachScreenLocation" type="String" mode="IN" optional="true"/>
        <attribute name="attachmentName" type="String" mode="IN" optional="true"/>
        <attribute name="xslfoAttachScreenLocationList" type="List" mode="IN" optional="true"/>
        <attribute name="attachmentNameList" type="List" mode="IN" optional="true"/>
        <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true">
            <description>
                The webSiteId of the WebSite this email should appear to be from, or
                in other words - from the point of view of the screen - the "current" WebSite.
                Used for building links to the web site, themeing, etc.
                NOTE: This is REQUIRED for store frontend emails (WARNING: Cannot be enforced! Caller must ensure).
                Backend emails can leave this empty.
            </description><!-- SCIPIO: Added description (and removed the old fix-me) -->
        </attribute>
        <attribute name="autoInferParams" type="Boolean" mode="IN" optional="true" default-value="true">
            <description>
                SCIPIO: If true (default), allows sendMailFromScreen implementations to automatically try
                to determine common services parameters and bodyParameters from each other.
                2019-02-04: This is now enabled by default and done by the Scipio sendMailFromScreen/sendMailFromScreenExt
                override in commonext component; it simply tries to determine the following fields from each other and
                put them in both service context and the bodyParameters: webSiteId, productStoreId, orderId.
                This is catch-all measure to prevent a number of bugs.
            </description>
        </attribute>
        <attribute name="subject" type="String" mode="OUT" optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="sendMailFromScreen" max-retry="3" engine="java"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMailFromScreen">
        <description>Send E-Mail From Screen Widget Service -
            SCIPIO: 2019-02-01: This service is now overridden in the CommonExt component
            for extended webSiteId/productStoreId/orderId handling; if you need the
            original behavior, call sendMailFromScreenStd instead.</description>
        <implements service="sendMailFromScreenInterface"/>
        <attribute name="hideInLog" type="Boolean" mode="IN" optional="true"/>
    </service>
    <service name="sendMailFromScreenStd" max-retry="3" engine="java"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMailFromScreen">
        <description>Send E-Mail From Screen Widget Service - 
            SCIPIO: This invokes the original implementation of the sendMailFromScreen service,
            without the supplemental webSiteId/productStoreId/orderId processing.</description>
        <implements service="sendMailFromScreenInterface"/>
        <attribute name="hideInLog" type="Boolean" mode="IN" optional="true"/>                        
    </service>
    <service name="sendMailHiddenInLogFromScreen" max-retry="3" engine="java" hideResultInLog="true"
        location="org.ofbiz.common.email.EmailServices" invoke="sendMailHiddenInLogFromScreen">
        <description>Send E-Mail hidden in log (password, etc.) From Screen Widget Service</description>
        <implements service="sendMailFromScreenInterface"/>
    </service>
    <service name="sendMailFromTemplateSetting" engine="simple"
        location="component://common/script/org/ofbiz/common/email/EmailServices.xml" invoke="sendMailFromTemplateSetting">
        <description>Send Email From Email Template Setting Service</description>
        <implements service="sendMailInterface"/>
        <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="false"/>
        <attribute name="partyIdTo" type="String" mode="IN" optional="true"/>
        <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="any"/>
        <attribute name="attachmentName" type="String" mode="IN" optional="true"/>
        <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="true"/>
    </service>

    <service name="prepareNotificationInterface" engine="interface"
            location="" invoke="">
        <description>Send Template Based Notification Service</description>
        <implements service="sendMailInterface"/>
        <attribute name="body" type="String" mode="INOUT" optional="true" allow-html="any"/>
        <attribute name="baseUrl" type="String" mode="IN" optional="true" allow-html="any"/>
        <attribute name="templateName" type="String" mode="IN" optional="false"/>
        <attribute name="templateData" type="Map" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="sendNotificationInterface" engine="interface"
            location="" invoke="">
        <description>Send Template Based Notification Service</description>
        <implements service="prepareNotificationInterface"/>
        <attribute name="body" type="String" mode="IN" optional="true" allow-html="any"/>
        <attribute name="templateName" type="String" mode="IN" optional="false"/>
        <attribute name="templateData" type="Map" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="sendGenericNotificationEmail" engine="java"
            location="org.ofbiz.common.email.NotificationServices" invoke="sendNotification">
        <description>Generic Template Based Notification Service</description>
        <implements service="sendNotificationInterface"/>
    </service>
    <!-- this service does not seem to exist, is not in the EmailServices.java file
    <service name="storeForwardedEmail" engine="java"
            location="org.ofbiz.common.email.EmailServices" invoke="storeForwardedEmail" auth="true">
        <description>Process incoming email. Try to determine partyIdFrom from email address.</description>
        <implements service="mailProcessInterface"/>
    </service>
    -->
    <service name="createEmailTemplateSetting" engine="entity-auto" invoke="create" default-entity-name="EmailTemplateSetting" auth="true">
        <description>Create a EmailTemplateSetting record</description>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateEmailTemplateSetting" engine="entity-auto" invoke="update" default-entity-name="EmailTemplateSetting" auth="true">
        <description>Update a EmailTemplateSetting record</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteEmailTemplateSetting" engine="entity-auto" invoke="delete" default-entity-name="EmailTemplateSetting" auth="true">
        <description>Delete a EmailTemplateSetting record</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>
</services>