Hi there

I'm looking for some help. I'm trying to build a helpdesk system in Drupal. I need to provide a staff interface via Drupal, but clients (whom I do not have a pre-determined list of) need to be able to interact entirely via email.

I'm trying to use Nodes as tickets, comments as replies, and use mailhandler with two different processors, one to create the node, and another via mail comment to import replies as comments on the node.

The difficulty I have is that when a new client (one who doesn't have a drupal account) submits a request, there's nothing to match the address against. So either (depending on whether i select skip authentication or not) it just gets assigned to anonymous, OR it gets silently rejected.

If it gets assigned to anonymous, then the rest of the workflow breaks as there's no email address to send back to. If it gets silently rejected, well that's obviously bad.

So I need to either find a way to have user accounts automatically created with the right email addresses on the import, OR I need to have a way of informing the client that they need to register first and give them a link to register on drupal.

Anyone know of a good way of doing this?

Apologies if this should be under Feeds, not sure which project has the relevant code.

Thanks

Ewan

Comments

Dane Powell’s picture

I think you'd want to write a custom authentication plugin for Mailhandler that creates new user accounts if a matching one doesn't exist.

paulwdru’s picture

Hi Ewan,

I'm also working out the same as yours. Do you find the parser works ? I found that the commands added by users all do not work, always empty in value though provided in default commands or email and therefore all imported nodes are always Unpublished. Also, it does NOT respect the default commands for Anonymous users too as stated in bugs. I tried tracing out the bugs in the source codes but very tough to me.

I once giving up Mailhandler. But now I have a plan.

1.) Create a Temp_Import_Node content type

2.) Create a Support content type

3.) First import all nodes & comments into the Temp_Import_Node content type

4.) Use Rules module & Conditional Rules module to react on the Temp_Import_Node after import, for eg,
a.) create a new user based on the sender's email if anonymous. (done successfully)
b.) create a new node in the Support content type. (done successfully)
c.) create a new thread comment in the Support content type. (still figuring out)

Thanks

shevgeny’s picture

@paulwdru, That is, if I understand correctly, you have tested the algorithm and it works?

paulwdru’s picture

@shegevy yes, with Rules module, plus this https://www.drupal.org/project/rules_conditional , you can do lots of amazing things without manual coding

shevgeny’s picture

@paulwdru, I did not succeed. Could you show your rules?

paulwdru’s picture

@shevgeny, which part is not successful ? Creating new user ?

shevgeny’s picture

Unfortunately the entire fourth paragraph:

4.) Use Rules module & Conditional Rules module to react on the Temp_Import_Node after import, for eg,
a.) create a new user based on the sender's email if anonymous. (done successfully)
b.) create a new node in the Support content type. (done successfully)

"After import" in the rules does not allow to cling to the type of import.
Create a user on the basis of what and how? It could be through the PHP standard method, but how to get e-mail addresses from the import?
Could you give your Rules?

paulwdru’s picture

@shevgeny

1.) In Rules, choose After Saving New Content, choose Temp_Import_Node

2.) Fetch Entity By Property, choose User, search criteria is Temp_Import_Node email field, this will output the search result to a variable, I named it as Fetched_Email.

3.) If Fetched_Email is empty (means the user doesn't exist), I choose Create Entity -> User based on the Temp_Import_Node email field.

Sorry, I can't give my rules directly without modification. You may try out the above hints first and see if successful.