BUG 11522 Change email 'from' when sending a pause case notification SOLVED

- If user send an email notification when he pauses a case. The FROM is always "PROCESSMAKER". Is it possible to change it to something else.
- Was added the field 'from name' for another title the email sent by to pause a case.
This commit is contained in:
Hector Cortez
2013-06-14 12:35:25 -04:00
parent f803a7b367
commit 56bbb29643
3 changed files with 39 additions and 0 deletions

View File

@@ -177,9 +177,14 @@ class AppNotes extends BaseAppNotes
$configNoteNotification['subject'] = G::LoadTranslation( 'ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION' ) . " @#APP_TITLE ";
$configNoteNotification['body'] = G::LoadTranslation( 'ID_CASE' ) . ": @#APP_TITLE<br />" . G::LoadTranslation( 'ID_AUTHOR' ) . ": $authorName<br /><br />$noteContent";
/*
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
*/
if (isset($aConfiguration['MESS_FROM_NAME']) && $aConfiguration['MESS_FROM_NAME'] != '') {
$sFrom = $aConfiguration['MESS_FROM_NAME'];
}
$hasEmailFrom = preg_match( '/(.+)@(.+)\.(.+)/', $sFrom, $match );

View File

@@ -688,6 +688,7 @@ class adminProxy extends HttpProxyController
$aFields['SMTPSecure'] = $_POST['UseSecureCon'];
$aFields['SMTPSecure'] = ($aFields['SMTPSecure'] == 'No') ? 'none' : $aFields['SMTPSecure'];
$aFields['MAIL_TO'] = $_POST['eMailto'];
$aFields['MESS_FROM_NAME'] = $_POST['FromName'];
$aFields['MESS_TRY_SEND_INMEDIATLY'] = $_POST['SendaTestMail'];//isset($_POST['form']['MESS_TRY_SEND_INMEDIATLY']) ? $_POST['form']['MESS_TRY_SEND_INMEDIATLY'] : '';
$aFields['MESS_TRY_SEND_INMEDIATLY'] = ($aFields['MESS_TRY_SEND_INMEDIATLY'] == 'true') ? '1' : $aFields['MESS_TRY_SEND_INMEDIATLY'];
$CfgUid='Emails';

View File

@@ -70,11 +70,15 @@ Ext.onReady(function(){
if(Ext.getCmp('SendaTestMail').checked) {
Ext.getCmp('eMailto').setVisible(true);
Ext.getCmp('eMailto').getEl().up('.x-form-item').setDisplayed(true);
Ext.getCmp('eFromName').setVisible(true);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(true);
}
else {
Ext.getCmp('eMailto').setVisible(false);
Ext.getCmp('eMailto').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('eMailto').setValue(' ');
Ext.getCmp('eFromName').setVisible(false);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(false);
}
}
@@ -98,11 +102,15 @@ Ext.onReady(function(){
Ext.getCmp('eMailto').setVisible(true);
Ext.getCmp('eMailto').setVisible(true);
Ext.getCmp('eMailto').setValue('');
Ext.getCmp('eFromName').setVisible(true);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(true);
}
else {
Ext.getCmp('eMailto').setVisible(false);
Ext.getCmp('eMailto').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('eMailto').setValue(' ');
Ext.getCmp('eFromName').setVisible(false);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(false);
}
Ext.getCmp('UseSecureConnection').setVisible(false);
@@ -387,6 +395,14 @@ Ext.onReady(function(){
disabled : true,
allowBlank: false
},
{
xtype: 'textfield',
fieldLabel: _('ID_FROM_NAME'),
id:'eFromName',
name:'eFromName',
width: 250,
disabled : true
},
{
id:'UseSecureConnection',
name:'UseSecureConnection',
@@ -430,6 +446,9 @@ Ext.onReady(function(){
Ext.getCmp('Password').setVisible(false);
Ext.getCmp('Password').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('eFromName').setVisible(false);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('UseSecureConnection').setVisible(false);
Ext.getCmp('UseSecureConnection').getEl().up('.x-form-item').setDisplayed(false);
} else {
@@ -453,6 +472,9 @@ Ext.onReady(function(){
// Ext.getCmp('AccountFrom').allowBlank = true;
}
Ext.getCmp('eFromName').setVisible(true);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(true);
if(!Ext.getCmp('UseSecureConnection').getValue()) {
Ext.getCmp('UseSecureConnection').setValue('No');
}
@@ -483,6 +505,12 @@ Ext.onReady(function(){
else {
Ext.getCmp('eMailto').setValue(res.data.MAIL_TO);
}
if(!res.data.MESS_FROM_NAME) {
Ext.getCmp('eFromName').setValue(' ');
} else {
Ext.getCmp('eFromName').setValue(res.data.MESS_FROM_NAME);
}
}
}
}
@@ -526,6 +554,8 @@ Ext.onReady(function(){
Ext.getCmp('SendaTestMail').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('eMailto').setVisible(false);
Ext.getCmp('eMailto').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('eFromName').setVisible(false);
Ext.getCmp('eFromName').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('UseSecureConnection').setVisible(false);
Ext.getCmp('UseSecureConnection').getEl().up('.x-form-item').setDisplayed(false);
Ext.getCmp('Test').setVisible(false);
@@ -725,6 +755,7 @@ var EditMethod = function()
Ext.getCmp('Password').setDisabled(false);
Ext.getCmp('SendaTestMail').setDisabled(false);
Ext.getCmp('eMailto').setDisabled(false);
Ext.getCmp('eFromName').setDisabled(false);
Ext.getCmp('UseSecureConnection').setDisabled(false);
Ext.getCmp('Test').setVisible(true);
Ext.getCmp('SaveChanges').setVisible(true);
@@ -745,6 +776,7 @@ var UnEditMethod = function()
Ext.getCmp('Password').setDisabled(true);
Ext.getCmp('SendaTestMail').setDisabled(true);
Ext.getCmp('eMailto').setDisabled(true);
Ext.getCmp('eFromName').setDisabled(true);
Ext.getCmp('UseSecureConnection').setDisabled(true);
Ext.getCmp('Test').setVisible(false);
Ext.getCmp('SaveChanges').setVisible(false);
@@ -924,6 +956,7 @@ saveMethod=function() {
UseSecureCon:UseSecureConnection,
SendaTestMail : Ext.getCmp('SendaTestMail').getValue() ,
eMailto : Ext.getCmp('eMailto').getValue(),
FromName: Ext.getCmp('eFromName').getValue(),
EnableEmailNotifications : Ext.getCmp('EnableEmailNotifications').getValue(),
EmailEngine : Ext.getCmp('EmailEngine').getValue(),
background: 'true'