I'm running OTRS 3.2.rc1 version (lasted version, notice: improve performance of customer processing...). I'm using postmaster filter to create a ticket when get an incoming email. Beside, the requirement is the system can create a new customer automatically during ticket creation (customer information includes in incoming email). Btw, I have to develop in System/PostMaster/NewTicket.pm, this file is implement to create a ticket by postmaster
Then, I inputed the coding as below:
Code: Select all
$Self->{DBObject}->Do(
SQL => "INSERT INTO customer_user "
."(login, email, customer_id, pw, create_time, create_by, change_time, change_by, valid_id, first_name, last_name, street, zip, mobile, phone, city)"
." VALUES ('".$login."', '".$email."', '".$customerId."', '".$password."', now(), 1, now(), 1, 1, '".$customerName
."', ' ', '".$street."', '".$postcode."', '".$mobile."', '".$phone."', '".$woonplaats."')"
);
Run test, successful. But I had no see any customer is created in Customer Admin page. However, check in DB, 1 record was created in customer_user table
Then, I went to bin/ folder, and implement deletecache, refresh Customer Admin page, the result like my expecting is existed that customer.
I saw in coding customer creation, Before customer creation, must create a session, cookie for that. So I assume the system will use this session and cookie to display. If I was right, how to create a session and cookie in coding of postmaster
How to reuse the coding of customer creation in Customer Admin page.
Thanks & regards,
Vu Nguyen