Added EmailAddresses creation.
This commit is contained in:
parent
3e66af6ef4
commit
1e5a512587
2 changed files with 27 additions and 1 deletions
|
@ -17,5 +17,11 @@
|
||||||
"name": "product_name",
|
"name": "product_name",
|
||||||
"value": "Zammad Demo System"
|
"value": "Zammad Demo System"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"EmailAddresses": [
|
||||||
|
{
|
||||||
|
"realname": "Zammad Demo System",
|
||||||
|
"email": "zammad@localhost",
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ module AutoWizzard
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
creates or updates Users and sets Settings based on the 'auto_wizzard.json' file placed in the root directory.
|
creates or updates Users, EmailAddresses and sets Settings based on the 'auto_wizzard.json' file placed in the root directory.
|
||||||
|
|
||||||
there is an example file 'contrib/auto_wizzard_example.json'
|
there is an example file 'contrib/auto_wizzard_example.json'
|
||||||
|
|
||||||
|
@ -60,6 +60,26 @@ returns
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# add EmailAddresses
|
||||||
|
if auto_wizzard_hash['EmailAddresses']
|
||||||
|
|
||||||
|
auto_wizzard_hash['EmailAddresses'].each { |email_address_data|
|
||||||
|
|
||||||
|
email_address_data_symbolized = email_address_data.symbolize_keys
|
||||||
|
|
||||||
|
email_address_data_symbolized = email_address_data_symbolized.merge(
|
||||||
|
{
|
||||||
|
:updated_by_id => 1,
|
||||||
|
:created_by_id => 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
EmailAddress.create_if_not_exists(
|
||||||
|
email_address_data_symbolized
|
||||||
|
)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue