Skip to content

Commit

Permalink
Add a new supportflow_imap_folders filter.
Browse files Browse the repository at this point in the history
A lot of IMAP accounts are configured to namespace any mailboxes
with `INBOX.` and attempting to move to `ARCHIVE` or creating it
fails silently, causing the e-mails to be fetched over and over
again. With this filter, one is able to change the name of the
archive box.

This is a temporary solution until more user-friendly archive
mailbox picker is in place, and/or #245 is implemented.
  • Loading branch information
kovshenin committed Jun 26, 2015
1 parent b65c201 commit b120f75
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions classes/class-supportflow-email-replies.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ function retrieve_email_replies() {

$email_accounts = SupportFlow()->extend->email_accounts->get_email_accounts( true );
foreach ( $email_accounts as $id => $email_account ) {
$imap_account = array_merge( $email_account, array(
'inbox' => 'INBOX',
'archive' => 'ARCHIVE',
'account_id' => $id,
) );
$imap_account = array_merge( $email_account,
apply_filters( 'supportflow_imap_folders', array(
'inbox' => 'INBOX',
'archive' => 'ARCHIVE',
'account_id' => $id,
), $email_account )
);

$this->download_and_process_email_replies( $imap_account );
}
Expand Down

0 comments on commit b120f75

Please sign in to comment.