IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Insérer une page HTML dans un Email outlook


Sujet :

JavaScript

  1. #1
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut Insérer une page HTML dans un Email outlook
    Bonjour,

    Je cherche désespérément à insérer une page HTML dans le corps d'un Email Outlook.
    J'utilise la fonction mailto: de javascript afin d'ouvrir Outlook, mais dans le corps du message j'ai systématiquement ObjectHTML, ou le code de la page elle même, mais jamais le rendu de la page.

    Savez vous comment faire pour obtenir ma page HTML dans le corps du message ?
    La page que j'essaie d'insérer est ma page courante.

    Voici le petit bout de code, mais je ne sais pas quoi mettre pour l'option &body=

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    window.location.href='mailto:{$DATA.cf_542}?Subject={$DATA.ticket_title}&body='+document.body;
    Merci

  2. #2
    Expert confirmé
    Avatar de RomainVALERI
    Homme Profil pro
    POOête
    Inscrit en
    Avril 2008
    Messages
    2 652
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : POOête

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 652
    Points : 4 164
    Points
    4 164
    Par défaut
    Ce ne serait pas plutôt une affaire de type MIME dans l'entête du mail que de contenu ? ^^

    (et au fait : tu as "inservé" ces lettres : inverser) (ton erreur était auto-référentielle, c'est très rare, je te remercie tu as ensoleillé ma journée eh non il ne m'en faut pas plus )

  3. #3
    skandhal
    Invité(e)
    Par défaut
    Pour le type mime je suis d'accord.

    Pour "Inserver" enfait il s'agit d'une lettre en trop je crois ^^ ça serait plutot Insérer

    ------- Générateur de sondage de RomainVALERI
    Génial celui là:
    Réponses à notre question, posée à 100 sous-préfets
    Dernière modification par skandhal ; 11/01/2011 à 13h09.

  4. #4
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut
    Un peu dyslexique sur le bord....
    Tu pourrais développer un peu plus ta réponse ?

    Merci

  5. #5
    skandhal
    Invité(e)
    Par défaut
    Il faut que tu changes le type MIME de ton mail qui normalement est: text/plain
    ce qui veut dire que ton mail contient du texte brut.

    Tu changes le MIME en mettant text/html, tu pourras écrire du html dans ton mail qui sera afficher comme une page HTML.

    Je pense que tu dois pouvoir faire ça avec Outlook. Si ce n'est pas le cas, Thunderbird de Mozilla le permet.

    Ensuite quand tu rédiges ton mail tu écris du HTML au lieu d'écrire du texte pur.

  6. #6
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut
    Merci pour cette réponse.
    J'ai bien paramétré Outlook par défaut avec l'option "HTML" pour les messages, mais idem. J'obtiens : [object HTMLBodyElement] . Ou lorsque je ré-écris le code html, celui-ci apparait sous forme de texte

    Malheureusement je ne peux pas changer de client messagerie.

  7. #7
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 096
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 096
    Points : 44 660
    Points
    44 660
    Par défaut
    Bonjour,
    [object HTMLBodyElement] correspond bien à ce qu tu passe comme paramètre, à savoir &body='+document.body;
    pour avoir le contenu, je pense qu'il faut au moins passer &body='+document.body.innerHTML;

  8. #8
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut
    Malheureusement si je prend le innerHTML je me retrouve avec le code (sous forme de texte) de la page HTML dans le corps de l'Email.


  9. #9
    skandhal
    Invité(e)
    Par défaut
    La réponse est dans ta signature (Blague)

    Peux tu nous mettre la totalité de ton code ou de ta fonction qui te permet de créer ton mail? Et ton code HTML?

    Histoire qu'on y voit plus clair. Parce que personnellement je ne sais plus ou chercher pour t'aider.

  10. #10
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut
    Pour décrire le process:
    J'utilise un CRM (Vtiger)
    A partir de l'interface GUI je peux faire appel à des templates pour générer des pages Html.
    Ce que je cherche à faire c'est à partir de la page générée via Php (je ne connais pas vraiment, j'arrive à deviner ce qui se passe), c'est d'envoyer celle-ci par Email dans le corps du message avec Outlook.

    Voici le code de la page. La seul modif que j'ai réalisé est l'ajout de du Javascript en fin de document. Pour le moment j'ai rien mis en &body=, car je n'ai pas obtenu le résultat recherché.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
     
    <HTML>
    <HEAD>
    <TITLE> HelpDesk </TITLE>
    </HEAD>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <BODY>
    <IMG src="/themes/images/management60px.jpg" BORDER="0">
    <span style="font-family: verdana; font-size: 22px"><b>Ticket Details</b></span>
    <br><br><table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr><td><b>{$TICKETID}: {$DATA.ticket_title}</b><br><small>{$UPDATEINFO}</small><small><b><p align="right">{$RELATEDTO}&nbsp;&nbsp;</p></b></small>
    </td>
    </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
     <tr>
    <td width="50%">
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td align="right" valign="top"><b>Assigned To:</b></td><td>{$DATA.assigned_user_id}</td></tr>
    <tr><td align="right" valign="top"><b>Priority:</b></td><td>{$DATA.ticketpriorities}</td></tr>
    <tr><td align="right" valign="top"><b>Severity:</b></td><td>{$DATA.ticketseverities}</td></tr>
    <tr><td align="right" valign="top"><b>Category:</b></td><td>{$DATA.ticketcategories}</td></tr>
    <tr><td align="right" valign="top"><b>Modified Time:</b></td><td>{$DATA.modifiedtime}</td></tr>
    <tr><td align="right" valign="top"><b>Contact:</b></td><td>{$DATA.cf_542}</td></tr>
    </table>
    </td>
    <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td align="right" valign="top"><b>Related To:</b></td><td>{$RELATEDTO}</td></tr>
    <tr><td align="right" valign="top"><b>Product Name:</b></td><td>{$DATA.product_id}</td></tr>
    <tr><td align="right" valign="top"><b>version:</b></td><td>{$DATA.cf_540}</td></tr>
    <tr><td align="right" valign="top"><b>Status:</b></td><td>{$DATA.ticketstatus}</td></tr>
    <tr><td align="right" valign="top"><b>Created Time:</b></td><td>{$DATA.createdtime}</td></tr>
    <tr><td align="right" valign="top"><b></b></td><td></td></tr>
    <tr><td align="right" valign="top"><b></b></td><td></td></tr>
    </table>
    </td>
    </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
    <td width="50%">
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td align="right" valign="top"><b>PTF:</b></td><td>{$DATA.cf_538}</td></tr>
    <tr><td align="right" valign="top"><b>Delivery Number:</b></td><td>{$DATA.cf_539}</td></tr>
    <tr><td align="right" valign="top"><b>Quick Analysis:</b></td><td>{$DATA.cf_543}</td></tr>
    </table>
    </td>
     
    </tr>
    </table>
    <br>
    <table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr>
    <td><b>Description Information</b></td>
    </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
    <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td>{$DATA.description}</td></tr>
    </table>
    </td>
    </tr>
    </table>
    <br>
    <table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr><td><b>Requested Data List</b></td></tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
     <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td>{$DATA.cf_547}</td></tr>
    </table>
    </td>
    </tr>
    </table>
    <br>
    <table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr><td><b>Comments</b></td></tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
    <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td>{$DATA.comments}</td></tr>
    </table>
    </td>
    </tr>
    </table>
    <br>
    <table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr><td><b>Solution</b></td></tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
    <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td>{$DATA.solution}</td></tr>
    </table>
    </td>
    </tr>
    </table>
    <br>
    <table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
    <tr><td><b>Ticket History</b></td></tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
    <tr>
    <td>
    <table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
    <tr><td>{$DATA.update_log}</td></tr>
    </table>
    </td>
    </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="670" style="font-family: verdana; font-size: 10px">
    <tr><td align="right">Generated on {$DATE} at {$TIME}</td></tr>
    </table>
    <script language="javascript">
    window.location.href='mailto:{$DATA.cf_542}?Subject={$DATA.ticket_title}&body=';
    </script>
    </BODY>
    </HTML>
    Merci pour votre aide

Discussions similaires

  1. [HTML 5] insérer une page html distante dans un mail?
    Par Zantetsu dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 11/11/2009, 13h47
  2. Insérer une page html dans une balise
    Par DolomatS dans le forum Langage
    Réponses: 5
    Dernier message: 13/07/2009, 11h20
  3. insérer une page html dans un code php
    Par darckangel01 dans le forum Langage
    Réponses: 5
    Dernier message: 20/12/2008, 11h28
  4. insérer une page html dans silverlight
    Par softysoft dans le forum Silverlight
    Réponses: 5
    Dernier message: 06/08/2008, 10h38
  5. Insérer une page php dans un cadre en HTML
    Par _SamSoft_ dans le forum Balisage (X)HTML et validation W3C
    Réponses: 30
    Dernier message: 07/05/2007, 12h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo