Hi,
I want to recive incoming mails in indivisual user's MySite (their respective mails which send to their emailid). There is a document library named "Personal Documents" already there.
How its possible that when user creates his personal site, incoming mail id (current user's email id) is automatically got populated in that document library.
I have tried the folowing approaches:
1. Tried to attach the WebProvisining handler
Result: Not gonna hit as it creates a site collection
2. Feature stapling
Result : not that much useful because i can not get current context so not able to get the current users id
3. Third approach is kind of "patch" (even not full proof). what i can do i can create a list (may be hidden list) in my site host and in master page i add the script that will automatically add the current user email in the list item as soon as user click on "My Content".
That list will always have one item.
Now in my feature reciver which i added through feature stapling i can read that list and get the email id of first item.
As soon as i get the email id i just remove that item.
That approach can fail as soon as two users try to create my site at same time. Also since adding entry in list is a Async event so it may possibel (.00% chances) that site got created first but item could't added in my site host.
4. Timer job
Create a list in my site host with column Title and IsMailIdSet
As soon as user click on my content, add entry in this list with email id and "false".
timer job will read that list, change specific user's my site's personal document library and then make entry in custom list as false.
Result: That would not do immediately.
One more question i have regarding incoming mail functionality .... what if i add some other user's email id in Incoming -Email section?
Would i get other users mails ?
Harsh