body = obj.body
for key, value in kwargs.items():
    subject = subject.replace('[%s]' % key.toupper(), value)
body = body.replace('[%s]' % key.toupper(), value)
return subject, body, obj.is_html
цикл через kwargs в python