Triggered rule in drupal to create user account automatically - php

I am working on drupal6 to develop a web application for office automation. I have an Employee content type. Each time I create an employee content, an account should be created with user name, and email id taken from fields of employee content. I've searched for the same on net, and found few solutions written completely in php, but i couldn't find how this can be done through rules-> triggered rules option in drupal(shown in figure). What entries should be provided in these username,email fields? I should get these from the content that I just created before triggering this. I tried exploring "Replacement patterns for saved content" option provided like [node:field_name], but no luck. Can someone help me with this?
None of the following (which are listed in "Token replacement patterns -> Replacement patterns for saved content") are working
[node:field_emp_name-formatted] Formatted and filtered text
[node:field_emp_name-raw] Raw, unfiltered text Warning: Token value contains raw user input.
[node:field_emp_mail-formatted] Formatted email address
[node:field_emp_mail-raw] Raw email address Warning: Token value contains raw user input.
Thanks in advance.

It suddenly started working for the following field values
User name: [node:field_emp_name-formatted]
User's E-mail: [node:field_emp_mail-raw]
I think it does not take "formatted" field for E-mail, since it has anchor tags, etc.,

Related

Docusign template fields not appearing? It's just blank

I have the API built in my custom CRM and its working fine but the issue is that the application is being sent out blank. We currently have it on the docusign console were we already have the necessary fields that will guide the client through the process instead of them having to drag and drop certain items.
Here is a text link of how it's being sent, which is wrong:
Here's how it should appear:
It's likely that the Roles listed in the Template don't match what's being defined in your API call. You'll want to check how your template is set up and make sure both Role Name and Routing Order match exactly in your API call.

DocuSign API - autofill fields and require signature

This is my first time trying to use the DocuSign API and I haven't been able to find an example of what I'm looking for.
What I'm trying to do is have a user fill out a form on a page, then push the data to DocuSign and use it to auto populate fields, so all they have to do is sign it. Is this possible?
I looked into Power Forms, but I don't seem to have that option when I go to edit the template. Plus, I already have an existing, functioning form I'd like to use.
Right now I'm just using the demo PHP code, which can be found here: DocuSign demo code
Also, when I do use it, I'm not seeing the fields that I've added and the user is able to drag and drop any fields they'd like. The working example can ben seen here: just add your email address to the email parameter
There are two ways of doing it, one is through Powerform which needs that you create a template with the document and create all the datalabels of the document in which dynamic data will be populated using URL. Another way to do it through API, where using API you will send datalabel's values. You can see an example at https://loancosample.docusign.com/ how DocuSign works. Let us know what you have tried.
For populating Powerform, you can find details at
https://support.docusign.com/guides/cdse-powerforms-populating-fields-web-powerform or
Auto Populate DocuSign PowerForm
You can find many examples using API in stackoverflow

MailChimp sending incorrect user IDs

EDIT: There's a chance I may have been a complete bonehead and mistook USER:UID for the member's ID when in fact it may be referring to the account admin ID. I have changed it to simply include the member's email address as the last URI segment. Is that an acceptable approach?
I'm setting up an EDM in MailChimp that includes a link to a website form. The URL is structured like so:
http://domain.com/foo/*|LIST:UID|*/*|USER:UID|*
The idea is that some PHP on that page gets the member info using the list ID and the user ID in the API (3.0) endpoint for use in a cURL operation:
$url = 'https://us4.api.mailchimp.com/3.0/lists/' . $listid . '/members/' . $userid;
The retrieved data would then pre-populate the form so that the user could edit the information and submit to 1) store the record of the submission locally in the CMS, and 2) send a PATCH command to the API.
This worked fine in my testing with a different MailChimp account, but when switching over to the production account, the *|USER:UID|* merge tag started sending incorrect hashes. I even changed the list but the ID stayed the same, and neither IDs were valid MD5 hashes.
To be clear, this is not an issue with authorization, I correctly changed the credentials (API key and username) and data center in the URL. If I manually enter a valid user ID into the URL the information is retrieved successfully. I simply can't get the correct user IDs to be embedded in the email.
Additionally, my initial testing using PUT instead of PATCH failed if the entered email address was not found in the list, sending back a message to use PUT (which I was).
Yeah, passing the email address back to your page is likely the best option for you here.
I know this question is old, but perhaps you were looking for *|UNIQID|* instead of *|USER:UID|*? According to MailChimp's documentation:
*|UNIQID|* Pulls in the $member->email->unique_id; (API function).
If used in an email campaign, this tag will pull in your subscriber's
unique ID. It can also be used to create unique links for subscribers.
The merge tag you were using, *|USER:UID|*, simply says:
*|USER:UID|* Displays the "u" parameter from your hosted Mailchimp audience forms.
While their documentation does not specify what the "u" parameter is, this other stack overflow answer to a related question mentions that it is an identifier for your account, which is exactly the same conclusion you came to in your question's edit :)
Personally, I prefer to pass unique IDs as opposed to email addresses for the sake of privacy. Some of my clients put a high value on privacy and security so we do not pass any personally identifiable information (PII) where it could be intercepted.

Build a survey system on top of google forms

We built a survey tool on top of google forms using wordpress.
Simply, you create a google form, create a private open link, put into a wordpress backend page, then the system processes the module server side and generates the necessary html file. When the user fills the form and sent it, via ajax the server use zend gdata to write the results on the spreadsheet connected to the form et voilat.
But this system is limited, also because google form is quite limited. We want to improve it.
That's why I'm asking your opinions to upgrade the system to have some more features:
We want to be able to keep the form open so that users can fill it in more than one occasion. theoretically then, we need to know which user the spreadsheet rows are connected to. This could be done by saving some sort of ID key to recognize the user, but then we don't know how to refill the fields in the form, since the spreadsheet created from the forms don't retain any sort of key to connect columns and form field.
We need more field types! like a file upload field that put the uploaded file in a specific gdrive folder.
We need to see the data for the single entry while google gives you only the whole spreadsheet that's quite hard to read.
It's not an easy task! Which solutions should we use to solve these problems?
Many thanks!
UPGRADE:
We decided to go by using a mix of google forms, google fusion tables, google charts via api access. Here's the simplified algorithm:
The admin user create his form via google forms and save the url. To have more field type, user can put a tag in the field comment, eg [file] for, well, files upload.
The url is put into an admin page of our system. The page fetch the content of the form page and extrapolate into an array, for every field, the title, the ID, the type and the comment; if there's some tag in the comment, this become the field type.
Using this data, system create if not existing a folder with a fusion table inside. if file fields are present, another subfolder is generated. Addresses of these folders and files is saved.
Using the array data, in the fusion table a column is created for each of the array fields, with a column title of this sort "[field_ID field_type]field_title", plus a column for the end user ID.
The admin user, can more over open or close the form.
When a user goes to the form page, the array is used to generate the form. If the system doesn't have in memory the user ID it means that the user has never filled up the form. Otherwise the system will use the user ID to fetch the data from the fusion table to populate the form.
When the user fills up the form, the entries are feed to the columns using the field ID as reference, plus the user ID. The user ID is also stored in the system the remember that the user already filled the form, as said in point 5. If files are uploaded, they are stored in a gdrive folder.
The admin user therefore can go to the admin page and see how many people has filled up the form, can ask for single user data, for summary data using google charts, can download a pdf of data from single user, every user, or summary.
Of course this is the idea, we have to build it. One first question is whether we should use javascript or php to communicate with google, so doing the processing on the client or server side...
If you're asking about Javascript vs PHP, you should know that the Javascript API can't write to a Google Spreadsheet because of Cross-Domain Security issues.
PHP can as it is a server side language. Zend Framework makes it easy to interact with Google Spreadsheets. http://framework.zend.com/manual/1.12/en/zend.gdata.spreadsheets.html
So go with PHP if that was your question.

Using Google's Contacts API's, how can I get the user's name and gmail address?

I know how to get the entire contacts list using Google Contacts API (I get a session token and use Google's Zend package for PHP).
But how can I get the person's name and email address? Currently, the Contacts API just seems to give all of the contacts. I'm not sure how to distinguish which email and name out of that list corresponds to the user's account.
Is there an easy way to get the user's full name and email address?
Any help would be useful. Thanks!
yes goto http://code.google.com/apis/contacts/docs/3.0/reference.html#ContactsFeed
and see the "Contacts feed"
they say to use the Default, it worked for me after using the default - lower case only.
request
http://www.google.com/m8/feeds/contacts/default/full
will give you the user's details.
http://www.google.com/m8/feeds/contacts/bla#gmail.com/full
will give you a contact info (if bla#gmail.com) is a contact.
If you ask for the "default" contact (i.e., me), you get what you need.
Mind that you need to write default with a lowercase d and not as written in the documentation.
THe xml returned for the default contact list will have the user's name and email within the "author" element. I don't know PHP, but the code might look something like this...
email = xml["author"].first["email"].first
name = xml["author"].first["name"].first
You can obtain this information by querying :
"https://www.google.com/m8/feeds/contacts/default/full?oauth_token=YourToken123"
and parsing your XML (SimpleXML example):
$user_email = $xmlResult->id;
$user_name = $xmlResult->author->name;
$xmlResult->author->name will give you the whole name as the user has configured it, so it's not certain that you will get in the "FirstName Lastname" format.

Categories