Updated how can i edit my script to import additionnal fields to mailchimp

时光怂恿深爱的人放手 提交于 2021-01-29 12:41:24

问题


hi and sorry for my errors

now i have problem with fields, actually instead of having : firstname, lastname, email fields, business asking me to have 2 additionnal fields, job and country and i've updated my script with this :

$person = @{
  email_address=$email
  status ="subscribed"
  merge_fields = @{
    FNAME=$firstname
    LNAME=$lastname
    title=$title
    Country=$country

         
$dayAgo = (Get-Date).AddDays(-5).Date
$users = Get-ADUser -Filter {whenCreated -ge $dayAgo} -Properties whenCreated, StartDate, country, title
# Iterates over each user in AD that is new

Foreach ($user in $users) {
    $flagDown = $false
    echo $user
    $Fname = $user.GivenName
    $Lname = $user.surname
    $email = $user.UserPrincipalName 
    $title = $user.title
    $country = $user.country
    addUsertoMailChimp $email $Fname $Lname $title $country
}

and my problem now is , there is no data pulling in mailchimp, i mean i have firstname, lastname, and email but i don't have country and job

Thank you in advance

来源:https://stackoverflow.com/questions/63811596/updated-how-can-i-edit-my-script-to-import-additionnal-fields-to-mailchimp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!