I've read all the forum posts on this topic to try to figure it out:
https://forum.espocrm.com/forum/deve...uestion-newbie
https://forum.espocrm.com/forum/gene...s-template-pdf
But I still can't figure it out. I just want to Email a PDF template on the Opportunity entity just like in Quotes "Email PDF".
I edited "..\client\modules\crm\src\views\opportunity\detai l.js" and added code from Quotes detail.js file:
With the above code inserted the Opportunity detail page doesn't display the data.. it just gets stuck at "Loading..".
And I don't know where to put the "getAttributesForEmail" function:
"..\crm\application\Espo\Modules\Crm\Services\ Oppo rtunity.php" or "..\crm\application\Espo\Modules\Advanced\Serv ices \Opportunity.php"
Please any support is appreciated here..
https://forum.espocrm.com/forum/deve...uestion-newbie
https://forum.espocrm.com/forum/gene...s-template-pdf
But I still can't figure it out. I just want to Email a PDF template on the Opportunity entity just like in Quotes "Email PDF".
I edited "..\client\modules\crm\src\views\opportunity\detai l.js" and added code from Quotes detail.js file:
PHP Code:
Espo.define('crm:views/opportunity/detail', 'views/detail', function (Dep) {
return Dep.extend({
setup: function () {
Dep.prototype.setup.call(this);
this.dropdownItemList.push({
name: 'composeEmail',
label: 'Email PDF'
});
},
actionComposeEmail: function () {
this.createView('pdfTemplate', 'views/modals/select-template', {
entityType: this.model.name
}, function (view) {
view.render();
this.listenToOnce(view, 'select', function (model) {
this.notify('Loading...');
this.ajaxPostRequest('Opportunity/action/getAttributesForEmail', {
opportunityId: this.model.id,
templateId: model.id
}).done(function (attributes) {
var viewName = this.getMetadata().get('clientDefs.Email.modalViews.compose') || 'views/modals/compose-email';
this.createView('composeEmail', viewName, {
attributes: attributes,
keepAttachmentsOnSelectTemplate: true
}, function (view) {
view.render();
this.notify(false);
}, this);
}.bind(this));
}, this);
}, this);
},
...
With the above code inserted the Opportunity detail page doesn't display the data.. it just gets stuck at "Loading..".
And I don't know where to put the "getAttributesForEmail" function:
"..\crm\application\Espo\Modules\Crm\Services\ Oppo rtunity.php" or "..\crm\application\Espo\Modules\Advanced\Serv ices \Opportunity.php"
Please any support is appreciated here..
Comment