Added also channel support, remove auto_wizard file after auto wizard has been done.
This commit is contained in:
parent
6f017e348c
commit
96fb303b7e
2 changed files with 37 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
],
|
||||
"EmailAddresses": [
|
||||
{
|
||||
"id": 1,
|
||||
"realname": "Zammad Demo System",
|
||||
"email": "zammad_demo@localhost"
|
||||
}
|
||||
|
@ -33,5 +34,19 @@
|
|||
{
|
||||
"name": "Demo Organization"
|
||||
}
|
||||
],
|
||||
"Channels": [
|
||||
{
|
||||
"area": "Email::Inbound",
|
||||
"adapter": "IMAP",
|
||||
"group_id": 1,
|
||||
"options": {
|
||||
"host": "mx1.example.com",
|
||||
"user": "some user",
|
||||
"password": "some pw",
|
||||
"ssl": true
|
||||
},
|
||||
"active":false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ returns
|
|||
}
|
||||
)
|
||||
|
||||
Organization.create_if_not_exists(
|
||||
Organization.create_or_update(
|
||||
organization_data_symbolized
|
||||
)
|
||||
}
|
||||
|
@ -103,12 +103,32 @@ returns
|
|||
}
|
||||
)
|
||||
|
||||
EmailAddress.create_if_not_exists(
|
||||
EmailAddress.create_or_update(
|
||||
email_address_data_symbolized
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
# create Channels
|
||||
if auto_wizard_hash['Channels']
|
||||
auto_wizard_hash['Channels'].each { |channel_data|
|
||||
|
||||
channel_data_symbolized = channel_data.symbolize_keys.merge(
|
||||
{
|
||||
updated_by_id: admin_user.id,
|
||||
created_by_id: admin_user.id
|
||||
}
|
||||
)
|
||||
|
||||
Channel.create(
|
||||
channel_data_symbolized
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
# remove auto wizard file
|
||||
FileUtils.rm auto_wizard_file_location
|
||||
|
||||
admin_user
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue