Using dragSortOrder on DownloadMail plugin

Re: [affinitymc] Using dragSortOrder on DownloadMail plugin

By Jason - August 19, 2010

Hi Brian,

You can alter your plugin to insert 0 as a dragSortOrder value. In the downloadMail.php file, go to the downloadMail_addRecord function. There you'll see the MySQL Query that inserts a record into CMS Builder, You can change it to this (I've highlighted the change in red)

// NOTE: $overviewHeaders is from imap_fetch_overview() and incomplete, $headersAsText is the actual message headers
$insert = "INSERT INTO `{$GLOBALS['TABLE_PREFIX']}_incoming_mail` SET
`createdDate` = '".mysql_escape( $mysqlDate )."',
`updatedDate` = NOW(),
`updatedByUserNum` = '0',

`from` = '".mysql_escape( mb_decode_mimeheader(@$overviewHeaders->from) )."',
`to` = '".mysql_escape( mb_decode_mimeheader(@$overviewHeaders->to) )."',
`subject` = '".mysql_escape( mb_decode_mimeheader(@$overviewHeaders->subject) )."',
`text` = '".mysql_escape( $text )."',
`html` = '".mysql_escape( $html )."',

`account` = '".mysql_escape( $accountName )."',
`headers` = '".mysql_escape( $headersAsText )."',
`errors` = '',
`processed` = 0,
`dragSortOrder` = 0";


When you add the line with dragSortOrder, it's important that there be a common after the 0 for processed as seen above.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Using dragSortOrder on DownloadMail plugin

It works splendidly! Thank you Jason!