2009年11月5日 星期四

客製化MOSS ALERT的EMAIL內容

I am trying to customize the alert notifications for a task list. I got to remove the “Description” field content and the “Title” field content from the email notifications that is being sent when a task is changed or assigned to somebody. I did the following steps for accomplishing the same:

1. I took a copy of the alerttemplates.xml and copied c:\temp folder in the server.

2. I added the field name “Description” in both the tags “ImmediateNotificationExcludedFields” and “DigestNotificationExcludedFields” under the SPAlertTemplateType.Tasks.

ID;Author;Title;Description;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;

ID;Author;Title;Description;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;

3. I did the above changes, saved the file, did an IISRESET and ran the command updatealerttemplates command using STSADM.exe.

4. I changed an item in a task and saved it.

5. The email that I received was not having the title in it, but the content in the “Description” field is still appearing and I need to exclude the same from the email notifications.

I tried this quite a number of times, but no luck. I am still seeing the Description field content in the email notifications that I receive.

I searched for all the possible options but could not get any beak through in this. If possible, I would like to help me out with this and also let me know, if there is any constraints in implementing this. Thanks in advance.

Sharepoint Server 2007(MOSS) Alert Email Troubleshoting--Part II

其他詳細步驟

1. Open the command window, go to the BIN folder and get the property of
Alerts-enabled to make sure the alerts are enabled for the timer service:
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url -pn
alerts-enabled
The expected output is


2. Open the MOSS Central Administration page, click Operations--Timer Job Status,
make sure the following two jobs are showing "success" and 100%
Change Log
Immediate Alerts


3. Make sure the account running the SharePoint Timer service is the account which has the administrator Full Control permission over the site and the full permission over the content database. Restart the timer service if required.

4. 檢查資料庫:
在content db中,timerlock
Open SQL Query Analyzer, connect to the content database of problematic site.
Run the following query and copy the result out.
Select * from timerlock
Let me know the server name seen in the LockedBy column is the same one of this SPS
server. This server is responsible for processing the timer service.

1. Run the following query against the content database of problematic site
select * from eventcache where EventData is not null
(找出尚未送出的ALERT,若完成寄送,EventData 會被設為null)
This will out put all fo the subscritions which have not been processed yet. We can see if there are some alerts which are not processed

2. select * from eventlog where ListID = 'xxx'
()
You can get the ListID from the EventCache table by running
Select * from EventCache and check the documents which correspond to the problematic list.

3. If you cannot find any record in the step 1, please perform the following tests:
Put filemon on the SPS server and we can see if the Timer service picks up the alert template during the whole process.
a. Upload a new document to the document library which is supposed to have the alerts. Begin running the filemon.
b. Run
select * from eventcache order by EventTime DESC
Check if the latest log is the one corresponds to your uploaded document. Make sure the EventData and ACL columns are not NULL.
c. After 5 minutes or more minutes, check the EventCache table again to see if the EventData and ACL columns are NULLed.
d. If so, stop filemon after the EventData and ACL columns are NULLed

Sharepoint Server 2007(MOSS) Alert Email Troubleshoting

0. 先檢查/解決MOSS本身傳送EMAIL的設定
至MOSS管理中心 > 作業 > 外寄電子郵件設定 設定相關資料
測試: 先找一個文件庫或清單,新增一個ALERT,若能收到設定完成的通知信,表示MOSS本身傳送EMAIL設定OK


以下針對當異動/新增發生時,無法收到ALERT EMAIL的狀況:
1. 先察看Timer Job的設定,因為ALERT是Timer Job來負責發送的,Timer Job是以SERVICE方式執行(Windows Sharepoint Service Timer)
先檢查SERVICE是否啟動
Made sure the account running the SharePoint Timer service is the account which has the administrator Full Control permission over the site and the full permission over the content database. Then we restarted the timer service.

2. 並檢查JOB的執行狀況
Opened the MOSS Central Administration page, clicked on Operations--Timer Job Status, made sure the following two jobs were showing "success" and 100%:
Change Log
Immediate Alerts

3. 再檢查設定:
Opened the command window, navigated to the BIN folder and got the property of Alerts-enabled to make sure the alerts are enabled for the timer service:
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url -pn alerts-enabled
The expected output is


4. 檢查content db的內容(參考以下的詳細步驟)
We found EventData and ACL are not NULL for the specific content database. This seems to be the key to the problem.

5. We checked the property job-immediate-alerts schedule
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url <http://server/> -pn
job-immediate-alerts
it showed Property Exist="No" for that specific site.

6. We used the following command to re-set the schedule
stsadm.exe -o setproperty -url -pn job-immediate-alerts -pv
"every 5 minutes between 0 and 59"

Alerts began to work.

如果發現有未執行的JOB,但是設定都正常,則需要重啟TIMER SERVICE,若是重啟失敗,則只有RESET SERVER了。