From 9e3bf0a42a439cf0acfaf7fb32587338696dd99f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 4 Oct 2012 09:09:27 +0200 Subject: [PATCH] Added documentation. --- app/models/channel/email_parser.rb | 46 ++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 3db850afb..4946afc59 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -25,11 +25,44 @@ class Channel::EmailParser :from_domain => 'example.com', :from_display_name => 'Some Name', :message_id => 'some_message_id@example.com', - :body => 'message body', + :to => 'Some System ', + :cc => 'Somebody ', + :subject => 'some message subject', + :body => 'some message body', :attachments => [ - + { + :data => 'binary of attachment', + :filename => 'file_name_of_attachment.txt', + :preferences => { + :content-alternative => true, + :Mime-Type => 'text/plain', + :Charset => 'iso-8859-1', + }, + }, ], - + + # ignore email header + :x-zammad-ignore => 'false', + + # customer headers + :x-zammad-customer-login => '', + :x-zammad-customer-email => '', + :x-zammad-customer-firstname => '', + :x-zammad-customer-lastname => '', + + # ticket headers + :x-zammad-group => 'some_group', + :x-zammad-state => 'some_state', + :x-zammad-priority => 'some_priority', + :x-zammad-owner => 'some_owner_login', + + # article headers + :x-zammad-article-visability => 'true', + :x-zammad-article-type => 'agent', + :x-zammad-article-sender => 'customer', + + # all other email headers + :some-header => 'some_value', } =end @@ -197,6 +230,9 @@ class Channel::EmailParser } end + # process postmaster filter + + # check ignore header return true if mail[ 'x-zammad-ignore'.to_sym ] == 'true' || mail[ 'x-zammad-ignore'.to_sym ] == true @@ -227,10 +263,10 @@ class Channel::EmailParser :created_by_id => 1 ) end - + # set current user UserInfo.current_user_id = user.id - + # get ticket# from subject ticket = Ticket.number_check( mail[:subject] )