Organization level key value map operation in apigee - apigee

I'm trying to use a key/value map operation on apigee edge but I can't seem to get any variables. I've since figured out that I have created an organization level key/value but I still can't figure out how to get the values. The data I created was from the samples and looks as follows:
{
"entry": [
{
"name": "Development",
"value": "65.87.18.18"
},
{
"name": "Staging",
"value": "65.87.18.22"
}
],
"name": "ipAddresses"
}
I've configured my policy up like so
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-1" mapIdentifier="ipAddresses">
<DisplayName>Key Value Map Operations 1</DisplayName>
<FaultRules/>
<Properties/>
<ExclusiveCache>false</ExclusiveCache>
<ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
<Get assignTo="myvar" index="1" >
<Key>
<Parameter ref="entry.Development"></Parameter>
</Key>
</Get>
<Scope>organization</Scope>
</KeyValueMapOperations>
But whenever I run a trace on this, myVar is always empty. I've tried various values for the Parameter ref such as
entry
Development
entry.Development
But nothing seems to work. Any suggestions? Do I need a basic auth header in there somewhere?
I've even tried doing this on an apiproxy scope and seeding the map at the same time, but even this doesn't return anything. And this is using the defaults from the policy!
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-2" mapIdentifier="newkey">
<DisplayName>Key Value Map Operations 2</DisplayName>
<FaultRules/>
<Properties/>
<ExclusiveCache>false</ExclusiveCache>
<ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
<InitialEntries>
<Entry>
<Key>
<Parameter>k1</Parameter>
</Key>
<Value>v1</Value>
</Entry>
<Entry>
<Key>
<Parameter>k2</Parameter>
</Key>
<Value>v3</Value>
<Value>v4</Value>
</Entry>
</InitialEntries>
<Get assignTo="mynewvar" index="1">
<Key>
<Parameter ref="k1"></Parameter>
</Key>
</Get>
<Scope>apiproxy</Scope>
</KeyValueMapOperations>
I can't help but think I'm missing something really obvious, or I've totally misunderstood the concept of the maps

For anyone else who has this problem, the issue was I was using
<Parameter ref="k1"></Parameter>
To retrieve the value when in fact it should be
<Parameter>k1</Parameter>

Related

Business Central - POST sales invoice line using REST API - setting multiple dimension values

We use Business Central cloud API to POST sales invoices from other system
After creating the the sales invoice we create sales invoice lines to it
by using
{BC Endpoint}/SalesInvoiceLine API call
but we are able to enter only two shortcut dimensions
eg.
"Shortcut_Dimension_1_Code": "{value_fordim1}",
"Shortcut_Dimension_2_Code": "{value_fordim2}
HOWEVER we need to set 4 dimensions for sales invoice line
We have tried to search MS API documentation for this situation but no luck
So far we haven't found a way to set all 4 dimension values to sales invoice line directly.
Current assumption is that we should somehow add new dimension set entry to BC
(or search suitable combination from Dimension Set Entry table)
and then somehow tie the sales invoice line to that Dimension Set Entry ID. However we do not know what API calls we could use for this.
Any guidance or help appriciated
In API v2.0 both entities salesInvoice and salesInvoiceLine contain a child object dimensionSetLines. If you run a request on the $metadata endpoint, you can find the definition in the API metadata.
<EntityType Name="dimensionSetLine">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Guid" Nullable="false"/>
<Property Name="code" Type="Edm.String" Nullable="false" MaxLength="20"/>
<Property Name="parentId" Type="Edm.Guid"/>
<Property Name="parentType" Type="Microsoft.NAV.dimensionSetEntryBufferParentType"/>
<Property Name="displayName" Type="Edm.String" MaxLength="30"/>
<Property Name="valueId" Type="Edm.Guid"/>
<Property Name="valueCode" Type="Edm.String"/>
<Property Name="valueDisplayName" Type="Edm.String" MaxLength="50"/>
To view all dimensions on an invoice, send a GET request on
https://<Tenant URL>/api/v2.0/salesInvoices(<Invoice ID (GUID)>)?$expand=dimensionSetLines
To create an invoice with multiple dimension, include the dimensionSetLines object in the salesInvoice entity when sending the POST request.
{
"invoiceDate": "2024-01-22",
"postingDate": "2024-01-22",
"customerNumber": "10000",
"dimensionSetLines": [
{
"code": "SALESCAMPAIGN",
"valueCode": "SUMMER"
},
{
"code": "PROJECT",
"valueCode": "VW"
},
{
"code": "BUSINESSGROUP",
"valueCode": "INTERCOMPANY"
}
]
}
We were able to solve this by using:
POST {BC-endpoint}/SalesInvoiceLine call
and just by entering the additional shortcut dimensions to the body
{
.......
"ShortcutDimCode4": "{value_for_dim4}",
"ShortcutDimCode5": "{value_for_dim5}"
}

Create VS extension with Analyzer and Options Page for Visual Studio 2022

I am trying (and failing) to port a Visual Studio [extension][1] to the latest version of Visual Studio.
The extension provides a set of Roslyn analyzers and code fixes as well as an options page to configure some aspects of the analyzers' operation.
A reduction of the problem can be demonstrated with the following steps:
Follow instructions [here][2] to create an analyzer
Follow instructions [here][3] to create an options page
Now try to combine the two into a single VSIX.
I have tried starting from #1 and then adding relevant items from #2 and vice versa. To no avail.
Unfortunately the two samples produce different project types, and target different .NET frameworks which doesn't simplify things.
Depending on which sample I start with either the analyzers or the options page are not loaded.
Here is what the .vsixmanifest looks like (started by using the options page sample and then adding in the analyzer code):
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MyToolsOptionsExtension.208a3dc2-4dd7-40db-bb6c-ab135b5ddaca" Version="1.0" Language="en-US" Publisher="ME" />
<DisplayName>MyToolsOptionsExtension</DisplayName>
<Description xml:space="preserve">Empty VSIX Project.</Description>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.16.0" DisplayName="Visual Studio MPF 16.0" d:Source="Installed" Version="[16.0,17.0)" />
</Dependencies>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0,)" DisplayName="Roslyn Language Services" />
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.Analyzer" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
</PackageManifest>
How can I debug why a specific asset defined in the .vsixmanifest file is not being loaded?
Would be great to see a sample where these are combined.
Peering into the compiled *.vsix (as zip file) it looks like an error in the auto-generation of the .pkgdef / catalog.json file, depending on what kind of project I start from. One or the other is missing from here despite having an identical vsixmanifest. For example catalog.json looks like this (note that the options page is missing):
"manifestVersion": "1.1",
"info": {
"id": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c,version=1.0",
"manifestType": "Extension"
},
"packages": [
{
"id": "Component.Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"version": "1.0",
"type": "Component",
"extension": true,
"dependencies": {
"Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c": "1.0",
"Microsoft.VisualStudio.Component.CoreEditor": "15.0",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices": "15.0"
},
"localizedResources": [
{
"language": "en-US",
"title": "Analyzer1",
"description": "This is a sample diagnostic extension for the .NET Compiler Platform (\"Roslyn\")."
}
]
},
{
"id": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"version": "1.0",
"type": "Vsix",
"payloads": [
{
"fileName": "Analyzer1.Vsix.vsix",
"size": 33906
}
],
"vsixId": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"extensionDir": "[installdir]\\Common7\\IDE\\Extensions\\pv2xi53w.cfr",
"installSizes": {}
}
]
}```
[1]: https://marketplace.visualstudio.com/items?itemName=YoavFrandzel.CheckedExceptions
[2]: https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix
[3]: https://learn.microsoft.com/en-us/visualstudio/extensibility/creating-an-options-page?view=vs-2022

Audit Alfresco Authority Deletion: no event is recorded

My goal is to audit deletion of authorities in Alfresco. When audit logging is enabled (which generates a lot of log entries), deleting a group results in these log entries (shortend):
/alfresco-api/pre/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-node/beforeDeleteNode/node=workspace://SpacesStore/a4f5e9bb-6584-4997-a550-6080d0dce177
/alfresco-api/post/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-api/post/AuthorityService/deleteAuthority/no-error=null
If I understand the documentation correctly, an audit XML file like this should record the first event:
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" class="org.alfresco.repo.audit.generator.AuthenticatedUserDataGenerator"/>
<DataGenerator name="personFullName" class="org.alfresco.repo.audit.generator.AuthenticatedPersonDataGenerator"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="name" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name"/>
</AuditPath>
</Application>
</Audit>
Note that in the source of the PathMap I use the path /alfresco-api/pre/AuthorityService/deleteAuthority as it appears in the first log entry. This looks correct to me, even though I am quite unsure how the Application element should look.
Putting this into the XML file tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-deleteAuthority-extractors.xml registers the application correclty:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/control
{
"enabled" : true,
"applications":
[
{
"name": "Alfresco Tagging Service",
"path" : "/tagging",
"enabled" : true
}
,
{
"name": "DeleteAuthority",
"path" : "/deleteAuthority",
"enabled" : true
}
,
{
"name": "alfresco-access",
"path" : "/alfresco-access",
"enabled" : true
}
]
}
But when I now delete a group, nothing is recorded. A query for the application returns an empty result:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/query/DeleteAuthority
{
"count":0,
"entries":
[
]
}
Question: Is my above audit application configuration correct? How would I have to change it to generate audit entries for the deletion of authorities?
Your path-mapping section is correct, your application definition though is not set correctly to track the correct path.
You probably should try something like :
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="authority" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name" dataTrigger="/deleteAuthority/args/name"/>
<GenerateValue key="deletingUser" dataGenerator="currentUser"/>
</AuditPath>
</Application>
</Audit>

Stream notifications subscription to Exchange server not working

I trying to stream notification from exchange server to my meterojs application.
I am sending following SOAP message as streaming subscription request:
{
"body":{
"m:Subscribe":{
"m:StreamingSubscriptionRequest":{
"t:FolderIds":{
"t:DistinguishedFolderId":{
"attributes":[
{
"Id":"calendar"
}
]
}
},
"t:EventTypes":{
"t:EventType":"CreatedEvent"
}
}
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":"",
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
I get following response with subscription ID:
{
"xmlns:s":"http://schemas.xmlsoap.org/soap/envelope/",
"MajorVersion":"15",
"MinorVersion":"1",
"MajorBuildNumber":"434",
"MinorBuildNumber":"14",
"xmlns:h":"http://schemas.microsoft.com/exchange/services/2006/types",
"xmlns:xsd":"http://www.w3.org/2001/XMLSchema",
"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
"xmlns:m":"http://schemas.microsoft.com/exchange/services/2006/messages",
"xmlns:t":"http://schemas.microsoft.com/exchange/services/2006/types",
"ResponseClass":"Success",
"m:ResponseCode":"NoError",
"m:SubscriptionId":"JwBkYjVwcjA3bWIxMzk3LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAA/wYNryw5gEeJFs3T7NXJvglEUWvERtMIEAAAAPP2lIvBykJBqcK1FSVk+mk="
}
Per documentation next step is to sent get strsaming events request with subscription ID:
{
"body":{
"GetStreamingEvents":{
"attributes":[
{
"xmlns":"http://schemas.microsoft.com/exchange/services/2006/messages"
}
],
"SubscriptionId":"JwBkYjVwcjA3bWIxMzk3LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAA/wYNryw5gEeJFs3T7NXJvglEUWvERtMIEAAAAPP2lIvBykJBqcK1FSVk+mk=",
"ConnectionTimeout":30
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:RequestServerVersion":{
"attributes":[
{
"Version":"Exchange2013"
}
]
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
On this I get response with status 500 and response body:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<s:Envelope
xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">
<s:Body>
<s:Fault>
<faultcode
xmlns:a=\"http://schemas.microsoft.com/exchange/services/2006/types\">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang=\"en-US\">The request failed schema validation: The element 'GetStreamingEvents' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'SubscriptionId' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'SubscriptionIds' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</faultstring>
<detail>
<e:ResponseCode
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">ErrorSchemaValidation
</e:ResponseCode>
<e:Message
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">The request failed schema validation.
</e:Message>
<t:MessageXml
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<t:LineNumber>3</t:LineNumber>
<t:LinePosition>201</t:LinePosition>
<t:Violation>The element 'GetStreamingEvents' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'SubscriptionId' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'SubscriptionIds' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Can you please advise on this.
Update:
New request with corrections:
{
"body":{
"m:GetStreamingEvents":{
"m:SubscriptionIds":{
"t:SubscriptionId":"JwBhbTRwcjA3bWIxMzk1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAnjsBVFou+0u0dglnKKEJ0CDsxAkYR9MIEAAAAPP2lIvBykJBqcK1FSVk+mk="
},
"m:ConnectionTimeout":30
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:RequestServerVersion":{
"attributes":[
{
"Version":"Exchange2013"
}
]
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
New response with different error:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<s:Envelope
xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">
<s:Body>
<s:Fault>
<faultcode
xmlns:a=\"http://schemas.microsoft.com/exchange/services/2006/types\">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang=\"en-US\">The request failed schema validation: The 'http://schemas.microsoft.com/exchange/services/2006/messages:ConnectionTimeout' element is invalid - The value 'undefined' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:StreamingSubscriptionConnectionTimeoutType' - The string 'undefined' is not a valid Int32 value.</faultstring>
<detail>
<e:ResponseCode
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">ErrorSchemaValidation
</e:ResponseCode>
<e:Message
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">The request failed schema validation.
</e:Message>
<t:MessageXml
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<t:LineNumber>3</t:LineNumber>
<t:LinePosition>361</t:LinePosition>
<t:Violation>The 'http://schemas.microsoft.com/exchange/services/2006/messages:ConnectionTimeout' element is invalid - The value 'undefined' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:StreamingSubscriptionConnectionTimeoutType' - The string 'undefined' is not a valid Int32 value.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
I don't think the online documentation is correct a working request should look like
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>target#Mailbox.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetStreamingEvents>
<m:SubscriptionIds>
<t:SubscriptionId>JwB0eTFwcjA0bWIwNzE4LmFwY3ByZDA0LnByb2Qub3V0bG9vay5jb20QAAAAhKGBpeZ5jEWJiN8rkO4xNxQ6jxrvRtMIEAAAAGhtpJbjoodMsSowkUdd9qk=</t:SubscriptionId>
</m:SubscriptionIds>
<m:ConnectionTimeout>15</m:ConnectionTimeout>
</m:GetStreamingEvents>
</soap:Body>
</soap:Envelope>
So the error your getting back makes sense because your missing the SubscriptionIds element. (Not sure why doco is wrong)
Cheers
Glen

Symfony ~2.4 composer update swiftmailer.mailer.default.transport.real dependency exception

After composer update, i started getting error message:
The service "swiftmailer.mailer.default.transport.real" has a dependency on a non-existent service "swiftmailer.transport.buffer"
After bit of research i found solutions:
http://error.bengtuo.com/page/13489.html
Symfony2 Monolog to Email Errors why swiftmailer.transport.real is non-existent service
Basically what they offer is to set swiftmail parameter spool: {type: memory} or create service description manually
I've added sppol to all configs: config.yml, config_test.yml, config_dev.yml but that did not helped. Then i've added entries in one of my bundles services.yml
swiftmailer.transport.simplemailinvoker:
class: Swift_Transport_SimpleMailInvoker
swiftmailer.transport.eventdispatcher:
class: Swift_Events_SimpleEventDispatcher
swiftmailer.transport.real:
class: Swift_Transport_MailTransport
arguments: [#swiftmailer.transport.simplemailinvoker, #swiftmailer.transport.eventdispatcher]
but that did not solved my problem ether.
My composer file looks like this:
http://pastebin.com/Wsfx22Lg
Any advice how to fix this?
Try my variant, it works for me:
swiftmailer.transport.simplemailinvoker:
class: Swift_Transport_SimpleMailInvoker
swiftmailer.transport.eventdispatcher:
class: Swift_Events_SimpleEventDispatcher
swiftmailer.replacementfactory:
class: Swift_StreamFilters_StringReplacementFilterFactory
swiftmailer.transport.buffer:
class: Swift_Transport_StreamBuffer
arguments: [#swiftmailer.replacementfactory]
swiftmailer.transport.real:
class: Swift_Transport_MailTransport
arguments: [#swiftmailer.transport.simplemailinvoker, #swiftmailer.transport.eventdispatcher]
Try adding this in your service.yml: worked for me
swiftmailer.transport.simplemailinvoker:
class: Swift_Transport_SimpleMailInvoker
swiftmailer.transport.eventdispatcher:
class: Swift_Events_SimpleEventDispatcher
swiftmailer.transport.buffer:
class: Swift_Transport_StreamBuffer
swiftmailer.transport.real:
class: Swift_Transport_MailTransport
arguments: [#swiftmailer.transport.simplemailinvoker, #swiftmailer.transport.eventdispatcher]
I used part of the previous answer and worked it. Hope this will work for you
The xml version of #Yury Pliashkou's answer:
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="swiftmailer.transport.simplemailinvoker" class="Swift_Transport_SimpleMailInvoker" />
<service id="swiftmailer.transport.eventdispatcher" class="Swift_Events_SimpleEventDispatcher" />
<service id="swiftmailer.replacementfactory" class="Swift_StreamFilters_StringReplacementFilterFactory" />
<service id="swiftmailer.transport.buffer" class="Swift_Transport_StreamBuffer">
<argument type="service" id="swiftmailer.replacementfactory"></argument>
</service>
<service id="swiftmailer.transport.real" class="Swift_Transport_MailTransport">
<argument type="service" id="swiftmailer.transport.simplemailinvoker"></argument>
<argument type="service" id="swiftmailer.transport.eventdispatcher"></argument>
</service>
</services>
</container>

Resources