Free Support Forum - aspose.cloud

Mail Merge Templates failing in Laravel using Aspose.Words Cloud API

Hi Aspose Support,

We are having issue getting MailMerge (Not Mustache) templates merged successfully using the Laravel Package. We are able to merge mustache templates successfully with no issues.

Is there any certain functions with special parameters in this package we should use?

Thanks.

@Softwareselskabet

Thank you for contacting Aspose Support.

It looks like you are using this Laravel Package for Aspose Cloud. We are not maintaining this Package anymore.

We would recommend you use this maintained PHP Library for Aspose.Words Cloud APIs. These Unit Tests should serve your purpose.

Please check Aspose.Words API Reference guide for description of executeMailMerge API and its parameters.

If you require any further information, please feel free to contact us.

Hello @sohail.aspose

Thanks for your reply.

We have already tried to use the PHP Library that you are referring to but we find that it’s not supporting PHP 7.1 as a result of the used dependency. Attached the issues we are getting when we try to install it via composer. image.png (11.6 KB)

What do you suggest, should we try to consume the API directly instead? Could you provide an example of how the request should be sent for “executeMailMerge” API ?

Thanks.

@Softwareselskabet

We have already tried to use the PHP Library that you are referring to but we find that it’s not supporting PHP 7.1 as a result of the used dependency. Attached the issues we are getting when we try to install it via composer.

We have logged a request (WORDSCLOUD-387) for our Development team to look into this issue and fix it. We will update you here as soon as the issue is fixed.

What do you suggest, should we try to consume the API directly instead? Could you provide an example of how the request should be sent for “executeMailMerge” API?

We recommend our users to use SDKs as they take care of a lot of low-level details of making requests and handling responses. But to help you understand the complete API process, I have written the following cURL example:

curl -v "https://api.aspose.cloud/v1.1/words/SampleMailMergeTemplate.docx/executeMailMerge?withRegions=false&destFileName=TestPostDocumentExecuteMailMerge.docx&appSID=B01A15E5-1B83-4B9A-8EB3-0F2BFA6AC766&signature=MAMSlswo1GndbA7fBIy30amXhTU" \
-X POST \
-d @SampleMailMergeTemplateData.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json"

Input Files: Input Files.zip (21.4 KB)
Output File: Output File.zip (39.0 KB)

@mateensajjad Ok, thanks for that. Could you give us an ETA when the support for PHP 7.1 will be added, so we can plan our road-map as well?

@Softwareselskabet

We are pleased to inform you that the issue has been fixed, please download the latest version (18.2) of words-sdk-php package from https://packagist.org/packages/aspose/words-sdk-php.
The SDK should work with PHP up to 7.2.3 (which is the latest).

@sohail.aspose Thanks for handling this in short period. But it seems that the latest commits to the repository is not tagged where the current version have the host as localhost and it require to be set manually when we define the config.

@Softwareselskabet

Thanks for pointing it out and we are fixing it.

@Softwareselskabet

But it seems that the latest commits to the repository is not tagged where the current version have the host as localhost and it require to be set manually when we define the config.

The issue has been fixed regarding setting host to an appropriate value. Please test the SDK and let us know your feedback.